Skip to content

Commit

Permalink
update admin panel tests
Browse files Browse the repository at this point in the history
  • Loading branch information
drusepth committed Jan 14, 2018
1 parent 95ea29c commit 99deb59
Showing 1 changed file with 10 additions and 37 deletions.
47 changes: 10 additions & 37 deletions spec/controllers/admin_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,35 +2,28 @@
require 'support/devise'

RSpec.describe AdminController, type: :controller do
describe 'logged in user' do
describe 'admin user' do
before do
user = create(:user)
user.update(site_administrator: true)
sign_in user
end

describe 'GET #dashboard' do
before { get :dashboard }
it { is_expected.to respond_with(200) }
end
end

describe 'GET #universes' do
before { get :universes }
it { is_expected.to respond_with(200) }
end

describe 'GET #characters' do
before { get :characters }
it { is_expected.to respond_with(200) }
end

describe 'GET #locations' do
before { get :locations }
it { is_expected.to respond_with(200) }
describe 'non-admin user' do
before do
user = create(:user)
sign_in user
end

describe 'GET #items' do
before { get :items }
it { is_expected.to respond_with(200) }
describe 'GET #dashboard' do
before { get :dashboard }
it { is_expected.to respond_with(302) }
end
end

Expand All @@ -39,25 +32,5 @@
before { get :dashboard }
it { is_expected.to respond_with(302) }
end

describe 'GET #universes' do
before { get :universes }
it { is_expected.to respond_with(302) }
end

describe 'GET #characters' do
before { get :characters }
it { is_expected.to respond_with(302) }
end

describe 'GET #locations' do
before { get :locations }
it { is_expected.to respond_with(302) }
end

describe 'GET #items' do
before { get :items }
it { is_expected.to respond_with(302) }
end
end
end

0 comments on commit 99deb59

Please sign in to comment.