ensl.org/spec/controllers/api/v1/maps_controller_spec.rb
2020-03-23 05:15:27 +02:00

29 lines
540 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. Find the right map id
it "return right map id" do
skip
map = create(:map)
get :index
expect(json["maps"].last["id"]).to eq(map.id)
end
end
end