ensl.org/spec/controllers/api/v1/maps_controller_spec.rb

30 lines
540 B
Ruby
Raw Normal View History

2019-10-17 18:29:15 +00:00
require 'rails_helper'
module Api
module V1
end
end
2015-08-01 15:34:01 +00:00
describe Api::V1::MapsController do
before do
2015-11-08 09:41:11 +00:00
request.accept = "application/json"
2020-03-23 02:10:31 +00:00
create_list :map, 20
end
2015-08-01 15:34:01 +00:00
2015-08-01 15:34:01 +00:00
describe '#index' do
2020-03-23 02:10:31 +00:00
it "return N maps" do
2015-08-01 15:34:01 +00:00
get :index
2020-03-23 02:10:31 +00:00
expect(response).to have_http_status(:success)
expect(json["maps"].length).to eq(20)
2015-08-01 15:34:01 +00:00
end
2020-03-23 02:10:31 +00:00
# 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
2015-08-01 15:34:01 +00:00
end
end