ensl.org/spec/controllers/api/v1/maps_controller_spec.rb
2020-03-23 04:10:31 +02:00

28 lines
511 B
Ruby
Executable file

require 'rails_helper'
module Api
module V1
end
end
describe Api::V1::MapsController do
before do
request.accept = "application/json"
create_list :map, 20
end
describe '#index' do
it "return N maps" do
get :index
expect(response).to have_http_status(:success)
expect(json["maps"].length).to eq(20)
end
# FIXME
#it "return right map id" do
# map = create(:map)
# get :index
# expect(json["maps"].last["id"]).to eq(map.id)
#end
end
end