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
|
|
|
|
request.accept = 'application/json'
|
2015-08-15 11:50:28 +00:00
|
|
|
end
|
2015-08-01 15:34:01 +00:00
|
|
|
|
|
|
|
describe '#index' do
|
2019-10-17 18:29:15 +00:00
|
|
|
let!(:map) { Map.new() }
|
2015-08-01 15:34:01 +00:00
|
|
|
|
|
|
|
it 'returns a list of maps' do
|
|
|
|
get :index
|
|
|
|
expect(response).to be_success
|
|
|
|
expect(json['maps'].length).to eq(1)
|
|
|
|
json_map = json['maps'][0]
|
|
|
|
expect(json_map['id']).to eq(map.id)
|
|
|
|
end
|
|
|
|
end
|
2015-08-15 11:50:28 +00:00
|
|
|
end
|