Skip to content

Commit ea8249e

Browse files
Fix: lint
Signed-off-by: Audrea Cook <[email protected]>
1 parent 3823720 commit ea8249e

File tree

3 files changed

+45
-45
lines changed

3 files changed

+45
-45
lines changed
Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
# frozen_string_literal: true
22

3-
require 'rails_helper'
3+
require "rails_helper"
44

5-
RSpec.describe 'AllCasaAdmin edit page', type: :system do
5+
RSpec.describe "AllCasaAdmin edit page", type: :system do
66
let(:admin) { create(:all_casa_admin) }
77

88
before do
@@ -14,7 +14,7 @@
1414
expect_password_section_hidden
1515

1616
# Click the Change Password button
17-
click_button 'Change Password'
17+
click_button "Change Password"
1818

1919
# Password section should now be visible
2020
expect_password_section_visible
@@ -23,13 +23,13 @@
2323
private
2424

2525
def expect_password_section_hidden
26-
expect(page).to have_selector('#collapseOne.collapse:not(.show)', visible: :all)
26+
expect(page).to have_selector("#collapseOne.collapse:not(.show)", visible: :all)
2727
end
2828

2929
def expect_password_section_visible
30-
expect(page).to have_selector('#collapseOne.collapse.show')
31-
expect(page).to have_field('all_casa_admin[password]')
32-
expect(page).to have_field('all_casa_admin[password_confirmation]')
33-
expect(page).to have_button('Update Password')
30+
expect(page).to have_selector("#collapseOne.collapse.show")
31+
expect(page).to have_field("all_casa_admin[password]")
32+
expect(page).to have_field("all_casa_admin[password_confirmation]")
33+
expect(page).to have_button("Update Password")
3434
end
3535
end
Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,35 @@
11
# frozen_string_literal: true
22

3-
require 'rails_helper'
3+
require "rails_helper"
44

5-
RSpec.describe 'AllCasaAdmin password change', type: :system do
6-
let(:admin) { create(:all_casa_admin, email: '[email protected]', password: '12345678') }
5+
RSpec.describe "AllCasaAdmin password change", type: :system do
6+
let(:admin) { create(:all_casa_admin, email: "[email protected]", password: "12345678") }
77

88
before do
99
sign_in admin
1010
visit edit_all_casa_admins_path
11-
click_button 'Change Password'
11+
click_button "Change Password"
1212
end
1313

14-
it 'shows error when password fields are blank', :aggregate_failures, :js do
15-
click_button 'Update Password'
16-
expect(page).to have_selector('#error_explanation.alert')
14+
it "shows error when password fields are blank", :aggregate_failures, :js do
15+
click_button "Update Password"
16+
expect(page).to have_selector("#error_explanation.alert")
1717
expect(page).to have_text("Password can't be blank")
1818
end
1919

2020
it "shows error when password confirmation doesn't match", :aggregate_failures, :js do
21-
fill_in 'all_casa_admin[password]', with: 'newpassword'
22-
fill_in 'all_casa_admin[password_confirmation]', with: 'wrongconfirmation'
23-
click_button 'Update Password'
24-
expect(page).to have_selector('#error_explanation.alert')
21+
fill_in "all_casa_admin[password]", with: "newpassword"
22+
fill_in "all_casa_admin[password_confirmation]", with: "wrongconfirmation"
23+
click_button "Update Password"
24+
expect(page).to have_selector("#error_explanation.alert")
2525
expect(page).to have_text("Password confirmation doesn't match Password")
2626
end
2727

28-
it 'shows success flash when password is updated', :aggregate_failures, :js do
29-
fill_in 'all_casa_admin[password]', with: 'newpassword'
30-
fill_in 'all_casa_admin[password_confirmation]', with: 'newpassword'
31-
click_button 'Update Password'
32-
expect(page).to have_selector('.header-flash')
28+
it "shows success flash when password is updated", :aggregate_failures, :js do
29+
fill_in "all_casa_admin[password]", with: "newpassword"
30+
fill_in "all_casa_admin[password_confirmation]", with: "newpassword"
31+
click_button "Update Password"
32+
expect(page).to have_selector(".header-flash")
3333
expect(page).to have_text("Password was successfully updated.")
3434
end
3535
end

spec/views/all_casa_admins/edit.html.erb_spec.rb

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,62 +1,62 @@
11
# frozen_string_literal: true
22

3-
require 'rails_helper'
3+
require "rails_helper"
44

5-
RSpec.describe 'all_casa_admins/edit', type: :view do
5+
RSpec.describe "all_casa_admins/edit", type: :view do
66
let(:user) { build_stubbed(:all_casa_admin) }
77

88
before do
99
assign(:user, user)
1010
render
1111
end
1212

13-
it 'renders the edit profile form', :aggregate_failures do
13+
it "renders the edit profile form", :aggregate_failures do
1414
expect(rendered).to have_selector("form[action='#{all_casa_admins_path}'][method='post']")
15-
expect(rendered).to have_field('all_casa_admin[email]')
16-
expect(rendered).to have_button('Update Profile')
15+
expect(rendered).to have_field("all_casa_admin[email]")
16+
expect(rendered).to have_button("Update Profile")
1717
end
1818

19-
it 'renders the change password collapse section, hidden by default', :aggregate_failures do
20-
expect(rendered).to have_selector('#collapseOne.collapse')
19+
it "renders the change password collapse section, hidden by default", :aggregate_failures do
20+
expect(rendered).to have_selector("#collapseOne.collapse")
2121
expect(rendered).not_to include('class="collapse show"')
22-
expect(rendered).to have_field('all_casa_admin[password]')
23-
expect(rendered).to have_field('all_casa_admin[password_confirmation]')
24-
expect(rendered).to have_button('Update Password')
22+
expect(rendered).to have_field("all_casa_admin[password]")
23+
expect(rendered).to have_field("all_casa_admin[password_confirmation]")
24+
expect(rendered).to have_button("Update Password")
2525
end
2626

27-
context 'when there are error and flash messages' do
27+
context "when there are error and flash messages" do
2828
before do
2929
user.errors.add(:email, "can't be blank")
30-
flash[:notice] = 'Profile updated'
30+
flash[:notice] = "Profile updated"
3131
render
3232
end
3333

34-
it 'renders error and flash messages partials', :aggregate_failures do
35-
expect(rendered).to have_selector('#error_explanation.alert')
34+
it "renders error and flash messages partials", :aggregate_failures do
35+
expect(rendered).to have_selector("#error_explanation.alert")
3636
expect(rendered).to have_text("can't be blank")
37-
expect(rendered).to have_selector('.header-flash')
38-
expect(rendered).to have_text('Profile updated')
37+
expect(rendered).to have_selector(".header-flash")
38+
expect(rendered).to have_text("Profile updated")
3939
end
4040
end
4141

42-
context 'when submitting the password change form' do
42+
context "when submitting the password change form" do
4343
before do
4444
sign_in user
4545
assign(:user, user)
4646
render
4747
end
4848

49-
it 'shows error when password fields are blank', :aggregate_failures do
49+
it "shows error when password fields are blank", :aggregate_failures do
5050
user.errors.add(:password, "can't be blank")
5151
render
52-
expect(rendered).to have_selector('#error_explanation.alert')
52+
expect(rendered).to have_selector("#error_explanation.alert")
5353
expect(rendered).to have_text("can't be blank")
5454
end
5555

56-
it 'shows error when password confirmation does not match', :aggregate_failures do
56+
it "shows error when password confirmation does not match", :aggregate_failures do
5757
user.errors.add(:password_confirmation, "doesn't match Password")
5858
render
59-
expect(rendered).to have_selector('#error_explanation.alert')
59+
expect(rendered).to have_selector("#error_explanation.alert")
6060
expect(rendered).to have_text("doesn't match Password")
6161
end
6262
end

0 commit comments

Comments
 (0)