Skip to content

Commit bd24505

Browse files
committed
rubocop
1 parent a9cba93 commit bd24505

File tree

1 file changed

+25
-30
lines changed

1 file changed

+25
-30
lines changed

spec/system/super_admin_spec.rb

Lines changed: 25 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,43 +1,38 @@
11
require 'rails_helper'
22

3-
RSpec.describe 'Admin' do
4-
subject { page }
3+
RSpec.describe 'Super Admin', type: :system do
54
let(:admin) { create(:admin_user, email: '[email protected]') }
65
let(:super_admin) { create(:super_admin) }
76

8-
before { admin }
9-
10-
describe 'login' do
11-
before do
12-
sign_in super_admin
13-
visit '/super_admins'
14-
end
15-
its(:current_path) { should == '/super_admins' }
7+
before do
8+
admin
9+
sign_in super_admin
10+
visit '/super_admins'
11+
click_link 'Admin Users'
12+
end
1613

17-
describe 'index page' do
18-
before { click_link 'Admin Users' }
14+
describe 'updating an admin from the index page' do
15+
it 'should not crash' do
16+
expect(page).to have_content('[email protected]')
1917

20-
it { should have_content('[email protected]') }
18+
first('.table_actions').click_link('Edit')
19+
fill_in 'Email', with: '[email protected]'
20+
click_button 'Update Admin user'
2121

22-
describe 'updating the admin user' do
23-
before do
24-
first('.table_actions').click_link('Edit')
25-
fill_in 'Email', with: '[email protected]'
26-
click_button 'Update Admin user'
27-
end
22+
expect(page).to have_content('Admin user was successfully updated.')
23+
expect(page).to have_content('[email protected]')
24+
end
25+
end
2826

29-
it 'should update the admin' do
30-
expect(page).to have_content('Admin user was successfully updated.')
31-
expect(page).to have_content('[email protected]')
32-
end
33-
end
27+
describe 'visiting new user page' do
28+
it 'should not crash' do
29+
click_link 'New Admin User'
30+
end
31+
end
3432

35-
describe 'walking around' do
36-
it 'should not crash' do
37-
click_link 'New Admin User'
38-
click_link 'Logout'
39-
end
40-
end
33+
describe 'logging out' do
34+
it 'should not crash' do
35+
click_link 'Logout'
4136
end
4237
end
4338
end

0 commit comments

Comments
 (0)