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

25 lines
557 B
Ruby
Raw Normal View History

2016-09-24 06:35:23 +00:00
# frozen_string_literal: true
2017-11-25 19:23:47 +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
2018-01-21 22:21:00 +00:00
create(:map)
2016-09-24 06:35:23 +00:00
get :active, format: :json
expect(JSON.parse(response.body).class).to be Array
end
end
end
end