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

20 lines
399 B
Ruby
Raw Normal View History

2015-11-08 09:41:11 +00:00
require "spec_helper"
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"
end
2015-08-01 15:34:01 +00:00
2015-11-08 09:41:11 +00:00
describe "#index" do
2015-08-01 15:34:01 +00:00
let!(:map) { create :map }
2015-11-08 09:41:11 +00:00
it "returns a list of maps" do
2015-08-01 15:34:01 +00:00
get :index
expect(response).to be_success
2015-11-08 09:41:11 +00:00
expect(json["maps"].length).to eq(1)
json_map = json["maps"][0]
expect(json_map["id"]).to eq(map.id)
2015-08-01 15:34:01 +00:00
end
end
end