Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invert "not_to have" as "to have_no" in feature specs #5101

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion spec/features/idv/doc_auth/address_step_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
let(:ial2_step_indicator_enabled) { false }

it 'does not show the step indicator' do
expect(page).not_to have_css('.step-indicator')
expect(page).to have_no_css('.step-indicator')
end
end
end
10 changes: 5 additions & 5 deletions spec/features/idv/doc_auth/document_capture_step_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
let(:ial2_step_indicator_enabled) { false }

it 'does not show the step indicator' do
expect(page).not_to have_css('.step-indicator')
expect(page).to have_no_css('.step-indicator')
end
end

Expand Down Expand Up @@ -191,7 +191,7 @@
end

it 'does not show the selfie upload option' do
expect(page).not_to have_content(t('doc_auth.headings.document_capture_selfie'))
expect(page).to have_no_content(t('doc_auth.headings.document_capture_selfie'))
end

it 'displays document capture tips' do
Expand All @@ -204,9 +204,9 @@
end

it 'does not display selfie tips' do
expect(page).not_to have_content(I18n.t('doc_auth.tips.document_capture_selfie_text1'))
expect(page).not_to have_content(I18n.t('doc_auth.tips.document_capture_selfie_text2'))
expect(page).not_to have_content(I18n.t('doc_auth.tips.document_capture_selfie_text3'))
expect(page).to have_no_content(I18n.t('doc_auth.tips.document_capture_selfie_text1'))
expect(page).to have_no_content(I18n.t('doc_auth.tips.document_capture_selfie_text2'))
expect(page).to have_no_content(I18n.t('doc_auth.tips.document_capture_selfie_text3'))
end

it 'proceeds to the next page with valid info' do
Expand Down
2 changes: 1 addition & 1 deletion spec/features/idv/doc_auth/email_sent_step_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
let(:ial2_step_indicator_enabled) { false }

it 'does not show the step indicator' do
expect(page).not_to have_css('.step-indicator')
expect(page).to have_no_css('.step-indicator')
end
end
end
2 changes: 1 addition & 1 deletion spec/features/idv/doc_auth/link_sent_step_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@
let(:ial2_step_indicator_enabled) { false }

it 'does not show the step indicator' do
expect(page).not_to have_css('.step-indicator')
expect(page).to have_no_css('.step-indicator')
end
end
end
2 changes: 1 addition & 1 deletion spec/features/idv/doc_auth/send_link_step_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@
let(:ial2_step_indicator_enabled) { false }

it 'does not show the step indicator' do
expect(page).not_to have_css('.step-indicator')
expect(page).to have_no_css('.step-indicator')
end
end
end
4 changes: 2 additions & 2 deletions spec/features/idv/doc_auth/ssn_step_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
let(:ial2_step_indicator_enabled) { false }

it 'does not show the step indicator' do
expect(page).not_to have_css('.step-indicator')
expect(page).to have_no_css('.step-indicator')
end
end
end
Expand Down Expand Up @@ -107,7 +107,7 @@
let(:ial2_step_indicator_enabled) { false }

it 'does not show the step indicator' do
expect(page).not_to have_css('.step-indicator')
expect(page).to have_no_css('.step-indicator')
end
end
end
Expand Down
2 changes: 1 addition & 1 deletion spec/features/idv/doc_auth/upload_step_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
let(:ial2_step_indicator_enabled) { false }

it 'does not show the step indicator' do
expect(page).not_to have_css('.step-indicator')
expect(page).to have_no_css('.step-indicator')
end
end
end
2 changes: 1 addition & 1 deletion spec/features/idv/doc_auth/verify_step_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@
let(:ial2_step_indicator_enabled) { false }

it 'does not show the step indicator' do
expect(page).not_to have_css('.step-indicator')
expect(page).to have_no_css('.step-indicator')
end
end

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
let(:ial2_step_indicator_enabled) { false }

it 'does not show the step indicator' do
expect(page).not_to have_css('.step-indicator')
expect(page).to have_no_css('.step-indicator')
end
end
end
18 changes: 9 additions & 9 deletions spec/features/idv/doc_capture/document_capture_step_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@
let(:ial2_step_indicator_enabled) { false }

it 'does not show the step indicator' do
expect(page).not_to have_css('.step-indicator')
expect(page).to have_no_css('.step-indicator')
end
end

Expand All @@ -120,7 +120,7 @@
end

it 'does not show the selfie upload option' do
expect(page).not_to have_content(t('doc_auth.headings.document_capture_selfie'))
expect(page).to have_no_content(t('doc_auth.headings.document_capture_selfie'))
end

it 'displays doc capture tips' do
Expand All @@ -133,9 +133,9 @@
end

it 'does not display selfie tips' do
expect(page).not_to have_content(I18n.t('doc_auth.tips.document_capture_selfie_text1'))
expect(page).not_to have_content(I18n.t('doc_auth.tips.document_capture_selfie_text2'))
expect(page).not_to have_content(I18n.t('doc_auth.tips.document_capture_selfie_text3'))
expect(page).to have_no_content(I18n.t('doc_auth.tips.document_capture_selfie_text1'))
expect(page).to have_no_content(I18n.t('doc_auth.tips.document_capture_selfie_text2'))
expect(page).to have_no_content(I18n.t('doc_auth.tips.document_capture_selfie_text3'))
end
end

Expand Down Expand Up @@ -253,7 +253,7 @@
end

it 'does not show the selfie upload option' do
expect(page).not_to have_content(t('doc_auth.headings.document_capture_selfie'))
expect(page).to have_no_content(t('doc_auth.headings.document_capture_selfie'))
end

it 'displays document capture tips' do
Expand All @@ -266,9 +266,9 @@
end

it 'does not display selfie tips' do
expect(page).not_to have_content(I18n.t('doc_auth.tips.document_capture_selfie_text1'))
expect(page).not_to have_content(I18n.t('doc_auth.tips.document_capture_selfie_text2'))
expect(page).not_to have_content(I18n.t('doc_auth.tips.document_capture_selfie_text3'))
expect(page).to have_no_content(I18n.t('doc_auth.tips.document_capture_selfie_text1'))
expect(page).to have_no_content(I18n.t('doc_auth.tips.document_capture_selfie_text2'))
expect(page).to have_no_content(I18n.t('doc_auth.tips.document_capture_selfie_text3'))
end

it 'proceeds to the next page with valid info' do
Expand Down
2 changes: 1 addition & 1 deletion spec/features/two_factor_authentication/sign_in_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,7 @@ def attempt_to_bypass_2fa
user = create(:user, :signed_up)
sign_in_before_2fa(user)

expect(page).not_to have_link(t('two_factor_authentication.piv_cac_fallback.question'))
expect(page).to have_no_link(t('two_factor_authentication.piv_cac_fallback.question'))
end
end

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@

visit account_path

expect(page).not_to have_content(t('headings.account.verified_account'))
expect(page).to have_no_content(t('headings.account.verified_account'))

click_link t('account.index.reactivation.link')
click_on t('links.account.reactivate.without_key')
Expand Down Expand Up @@ -89,7 +89,7 @@
click_on t('links.account.reactivate.without_key')
click_on t('links.cancel')

expect(page).not_to have_content('[id="reactivate-account-modal"]')
expect(page).to have_no_content('[id="reactivate-account-modal"]')
end
end

Expand Down
2 changes: 1 addition & 1 deletion spec/features/users/regenerate_personal_key_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ def sign_up_and_view_personal_key
end

def expect_confirmation_modal_to_appear_with_first_code_field_in_focus
expect(page).not_to have_xpath("//div[@id='personal-key-confirm'][@class='display-none']")
expect(page).to have_no_xpath("//div[@id='personal-key-confirm'][@class='display-none']")
expect(page.evaluate_script('document.activeElement.name')).to eq 'personal_key'
end

Expand Down
6 changes: 3 additions & 3 deletions spec/features/users/sign_up_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

sign_up

expect(page).not_to have_content t('errors.messages.confirmation_invalid_token')
expect(page).to have_no_content t('errors.messages.confirmation_invalid_token')
end

scenario 'with invalid token' do
Expand All @@ -20,7 +20,7 @@

sign_up

expect(page).not_to have_content t('errors.messages.confirmation_invalid_token')
expect(page).to have_no_content t('errors.messages.confirmation_invalid_token')
end

scenario 'with no token and an email address that contains a nil token' do
Expand All @@ -30,7 +30,7 @@

sign_up

expect(page).not_to have_content t('errors.messages.confirmation_invalid_token')
expect(page).to have_no_content t('errors.messages.confirmation_invalid_token')
end
end

Expand Down
2 changes: 1 addition & 1 deletion spec/features/users/verify_profile_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
end

it 'does not show step indicator progress' do
expect(page).not_to have_css('.step-indicator')
expect(page).to have_no_css('.step-indicator')
end
end
end
Expand Down
4 changes: 2 additions & 2 deletions spec/features/visitors/password_recovery_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -178,10 +178,10 @@
context 'when password form values are invalid' do
it 'does not allow the user to submit until password score is good', js: true do
fill_in t('forms.passwords.edit.labels.password'), with: 'invalid'
expect(page).not_to have_button(t('forms.passwords.edit.buttons.submit'))
expect(page).to have_no_button(t('forms.passwords.edit.buttons.submit'))

fill_in t('forms.passwords.edit.labels.password'), with: 'password@132!'
expect(page).not_to have_button(t('forms.passwords.edit.buttons.submit'))
expect(page).to have_no_button(t('forms.passwords.edit.buttons.submit'))

fill_in t('forms.passwords.edit.labels.password'), with: 'a unique and exciting zxjsahfas'
expect(page).to have_button(t('forms.passwords.edit.buttons.submit'))
Expand Down
6 changes: 3 additions & 3 deletions spec/support/idv_examples/confirmation_step.rb
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
let(:ial2_step_indicator_enabled) { false }

it 'does not show step indicator progress' do
expect(page).not_to have_css('.step-indicator')
expect(page).to have_no_css('.step-indicator')
end
end
end
Expand Down Expand Up @@ -97,15 +97,15 @@
'.step-indicator__step--current',
text: t('step_indicator.flows.idv.secure_account'),
)
expect(page).not_to have_css('.step-indicator__step--pending')
expect(page).to have_no_css('.step-indicator__step--pending')
end
end

context 'ial2 step indicator disabled' do
let(:ial2_step_indicator_enabled) { false }

it 'does not show step indicator progress' do
expect(page).not_to have_css('.step-indicator')
expect(page).to have_no_css('.step-indicator')
end
end
end
Expand Down