metamaps--metamaps/spec/controllers/explore_controller_spec.rb

25 lines
563 B
Ruby
Raw Normal View History

2016-09-24 06:35:23 +00:00
# frozen_string_literal: true
2017-11-06 16:15:18 +00:00
2016-09-24 06:35:23 +00:00
require 'rails_helper'
RSpec.describe ExploreController, type: :controller do
before :each do
sign_in create(:user)
end
describe 'GET explore/active' do
context 'always returns an array' do
it 'with 0 records' do
Map.delete_all
get :active, format: :json
expect(JSON.parse(response.body)).to eq []
end
it 'with 1 record' do
map = create(:map)
get :active, format: :json
expect(JSON.parse(response.body).class).to be Array
end
end
end
end