Skip to content

Commit

Permalink
Merge pull request #3987 from DFE-Digital/dependabot/bundler/rubocop-…
Browse files Browse the repository at this point in the history
…rspec-2.26.0

Bump rubocop-rspec from 2.25.0 to 2.26.0
  • Loading branch information
JR-G authored Jan 5, 2024
2 parents a8285a4 + 7cf3de7 commit bd74f59
Show file tree
Hide file tree
Showing 78 changed files with 263 additions and 261 deletions.
6 changes: 3 additions & 3 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -623,16 +623,16 @@ GEM
unicode-display_width (>= 2.4.0, < 3.0)
rubocop-ast (1.30.0)
parser (>= 3.2.1.0)
rubocop-capybara (2.19.0)
rubocop-capybara (2.20.0)
rubocop (~> 1.41)
rubocop-factory_bot (2.24.0)
rubocop-factory_bot (2.25.0)
rubocop (~> 1.33)
rubocop-rails (2.23.1)
activesupport (>= 4.2.0)
rack (>= 1.1)
rubocop (>= 1.33.0, < 2.0)
rubocop-ast (>= 1.30.0, < 2.0)
rubocop-rspec (2.25.0)
rubocop-rspec (2.26.0)
rubocop (~> 1.40)
rubocop-capybara (~> 2.17)
rubocop-factory_bot (~> 2.22)
Expand Down
2 changes: 2 additions & 0 deletions config/rubocop/factory_bot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ FactoryBot/CreateList:
Enabled: false
FactoryBot/AssociationStyle:
Enabled: false
FactoryBot/ExcessiveCreateList:
Enabled: false
FactoryBot/FactoryAssociationWithStrategy:
Exclude:
- 'spec/factories/access_requests.rb'
Expand Down
6 changes: 3 additions & 3 deletions docs/spec/govuk_tech_docs/open_api/renderer_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,8 @@
rendered = render.api_full

rendered = Capybara::Node::Simple.new(rendered)
expect(rendered).not_to have_css('h2#servers')
expect(rendered).not_to have_css('div#server-list')
expect(rendered).to have_no_css('h2#servers')
expect(rendered).to have_no_css('div#server-list')
end

it 'renders a server with no description' do
Expand All @@ -89,7 +89,7 @@
rendered = Capybara::Node::Simple.new(rendered)
expect(rendered).to have_css('h2#servers')
expect(rendered).to have_css('div#server-list>a', text: 'https://example.com')
expect(rendered).not_to have_css('div#server-list>p')
expect(rendered).to have_no_css('div#server-list>p')
end

it 'renders a list of servers' do
Expand Down
16 changes: 8 additions & 8 deletions spec/components/add_course_button_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
let(:provider) { build(:provider, study_sites: [build(:site, :study_site)], recruitment_cycle:) }

it 'renders a study sites link' do
expect(rendered_content).not_to have_link(
expect(rendered_content).to have_no_link(
'add a study site',
href: publish_provider_recruitment_cycle_study_sites_path(
provider.provider_code,
Expand Down Expand Up @@ -72,7 +72,7 @@
let(:provider) { build(:provider, :accredited_provider, recruitment_cycle:) }

it 'renders an accredited provider link' do
expect(rendered_content).not_to have_link(
expect(rendered_content).to have_no_link(
'add an accredited provider',
href: publish_provider_recruitment_cycle_accredited_providers_path(
provider.provider_code,
Expand Down Expand Up @@ -106,7 +106,7 @@
end

it 'renders a schools link' do
expect(rendered_content).not_to have_link(
expect(rendered_content).to have_no_link(
'add a school',
href: publish_provider_recruitment_cycle_schools_path(
provider.provider_code,
Expand All @@ -120,7 +120,7 @@
let(:provider) { build(:provider, study_sites: [build(:site, :study_site)], sites: [build(:site)], recruitment_cycle:) }

it 'renders a study sites link' do
expect(rendered_content).not_to have_link(
expect(rendered_content).to have_no_link(
'add a study site',
href: publish_provider_recruitment_cycle_study_sites_path(
provider.provider_code,
Expand All @@ -140,7 +140,7 @@
end

it 'renders a schools link' do
expect(rendered_content).not_to have_link(
expect(rendered_content).to have_no_link(
'add a school',
href: publish_provider_recruitment_cycle_schools_path(
provider.provider_code,
Expand All @@ -154,7 +154,7 @@
let(:provider) { build(:provider, :accredited_provider, study_sites: [build(:site, :study_site)], sites: [build(:site)], recruitment_cycle:) }

it 'renders a study sites link' do
expect(rendered_content).not_to have_link(
expect(rendered_content).to have_no_link(
'add a study site',
href: publish_provider_recruitment_cycle_study_sites_path(
provider.provider_code,
Expand All @@ -164,7 +164,7 @@
end

it 'renders an accredited provider link' do
expect(rendered_content).not_to have_link(
expect(rendered_content).to have_no_link(
'add an accredited provider',
href: publish_provider_recruitment_cycle_accredited_providers_path(
provider.provider_code,
Expand All @@ -174,7 +174,7 @@
end

it 'renders a schools link' do
expect(rendered_content).not_to have_link(
expect(rendered_content).to have_no_link(
'add a school',
href: publish_provider_recruitment_cycle_schools_path(
provider.provider_code,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,11 @@
end

it 'does not tell candidates the 3-year residency rule' do
expect(page).not_to have_text('To apply for this teaching apprenticeship course, you’ll need to have lived in the UK for at least 3 years before the start of the course')
expect(page).to have_no_text('To apply for this teaching apprenticeship course, you’ll need to have lived in the UK for at least 3 years before the start of the course')
end

it 'does not tell candidates about settled and pre-settled status' do
expect(page).not_to have_text('EEA nationals with settled or pre-settled status under the')
expect(page).to have_no_text('EEA nationals with settled or pre-settled status under the')
end
end

Expand Down Expand Up @@ -87,11 +87,11 @@
end

it 'does not tell candidates the 3-year residency rule' do
expect(page).not_to have_text('To apply for this teaching apprenticeship course, you’ll need to have lived in the UK for at least 3 years before the start of the course')
expect(page).to have_no_text('To apply for this teaching apprenticeship course, you’ll need to have lived in the UK for at least 3 years before the start of the course')
end

it 'does not tell candidates about settled and pre-settled status' do
expect(page).not_to have_text('EEA nationals with settled or pre-settled status under the')
expect(page).to have_no_text('EEA nationals with settled or pre-settled status under the')
end
end

Expand Down
4 changes: 2 additions & 2 deletions spec/components/find/phase_banner/view_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@ module PhaseBanner
allow(Settings.environment).to receive(:name).and_return(environment)
render_inline(described_class.new)

expect(page).to have_selector(".govuk-phase-banner .govuk-tag--#{colour}")
expect(page).to have_css(".govuk-phase-banner .govuk-tag--#{colour}")
end
end

context "when no value is passed in to 'no_border'" do
it 'renders a border' do
render_inline(described_class.new)
expect(page).not_to have_css('.app-phase-banner--no-border')
expect(page).to have_no_css('.app-phase-banner--no-border')
end
end

Expand Down
4 changes: 2 additions & 2 deletions spec/components/gcse_row_content_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,8 @@

render_inline(described_class.new(course: course.decorate))

expect(page).not_to have_content('Grade 4 (C) or above in English and maths, or equivalent qualification')
expect(page).not_to have_content('Grade 4 (C) or above in English, maths and science, or equivalent qualification')
expect(page).to have_no_content('Grade 4 (C) or above in English and maths, or equivalent qualification')
expect(page).to have_no_content('Grade 4 (C) or above in English, maths and science, or equivalent qualification')
end
end

Expand Down
2 changes: 1 addition & 1 deletion spec/components/header_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

it "doesn't contain a sign out link if no current user" do
render_inline(described_class.new(service_name: 'test'))
expect(component).not_to have_text('Sign out')
expect(component).to have_no_text('Sign out')
end

context 'for an admin user' do
Expand Down
2 changes: 1 addition & 1 deletion spec/components/notification_banner_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
end

it "doesn't add the success class" do
expect(component).not_to have_css('.govuk-notification-banner--success')
expect(component).to have_no_css('.govuk-notification-banner--success')
end

it "has a default title of 'Important'" do
Expand Down
4 changes: 2 additions & 2 deletions spec/components/phase_banner_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
allow(Settings.environment).to receive(:name).and_return(environment)
render_inline(described_class.new)

expect(page).to have_selector(".govuk-phase-banner .govuk-tag--#{colour}")
expect(page).to have_css(".govuk-phase-banner .govuk-tag--#{colour}")
end
end

Expand All @@ -35,7 +35,7 @@
context "when no value is passed in to 'no_border'" do
it 'renders a border' do
render_inline(described_class.new)
expect(page).not_to have_css('.app-phase-banner--no-border')
expect(page).to have_no_css('.app-phase-banner--no-border')
end
end

Expand Down
2 changes: 1 addition & 1 deletion spec/components/search_result_title_component_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@

expect(page).to have_text("No results found for ‘#{query}’")
expect(page).to have_link('Change your search', href: '/test')
expect(page).not_to have_text("if the #{search_resource} you’re looking for is not listed.")
expect(page).to have_no_text("if the #{search_resource} you’re looking for is not listed.")
end

def render_component(results_count)
Expand Down
2 changes: 1 addition & 1 deletion spec/components/support_title_bar_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
end

it 'does not render the provided title' do
expect(component).not_to have_text("Recruitment cycle #{Settings.current_recruitment_cycle_year}")
expect(component).to have_no_text("Recruitment cycle #{Settings.current_recruitment_cycle_year}")
end

it 'does not render the recruitment cycle link' do
Expand Down
2 changes: 1 addition & 1 deletion spec/components/title_bar_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
end

it 'does not render the provided title' do
expect(component).not_to have_text('BAT School')
expect(component).to have_no_text('BAT School')
end

it 'does not render the recruitment cycle link' do
Expand Down
4 changes: 2 additions & 2 deletions spec/features/auth/persona_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ def i_am_given_the_option_to_login_as_an_admin
end

def and_i_do_not_see_persona_related_text
expect(auth_sign_in_page).not_to have_text('Use Personas to access an account.')
expect(auth_sign_in_page).not_to have_link('Sign in using a Persona')
expect(auth_sign_in_page).to have_no_text('Use Personas to access an account.')
expect(auth_sign_in_page).to have_no_link('Sign in using a Persona')
end
end
2 changes: 1 addition & 1 deletion spec/features/auth/provider_user_signs_in_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def then_i_am_expected_to_sign_in
end

def when_i_sign_in
click_button 'Sign in using DfE Sign-in'
click_link_or_button 'Sign in using DfE Sign-in'
end

def then_i_can_access_the_publish
Expand Down
2 changes: 1 addition & 1 deletion spec/features/auth/support_user_signs_in_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ def then_i_am_expected_to_sign_in
end

def when_i_sign_in
click_button 'Sign in using DfE Sign-in'
click_link_or_button 'Sign in using DfE Sign-in'
end

def then_i_can_access_the_support_interface
Expand Down
8 changes: 4 additions & 4 deletions spec/features/find/feature_flags_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,11 @@ def then_i_should_see_the_existing_feature_flags
end

def when_i_activate_the_feature
within(feature_card) { click_link 'Confirm environment to make changes' }
within(feature_card) { click_link_or_button 'Confirm environment to make changes' }
fill_in 'Type ‘test’ to confirm that you want to proceed', with: 'test'
click_button 'Continue'
click_link_or_button 'Continue'

within(feature_card) { click_button 'Activate' }
within(feature_card) { click_link_or_button 'Activate' }
end

def then_the_feature_is_activated
Expand All @@ -72,7 +72,7 @@ def then_the_feature_is_activated
end

def when_i_deactivate_the_feature
within(feature_card) { click_button 'Deactivate' }
within(feature_card) { click_link_or_button 'Deactivate' }
end

def then_the_feature_is_deactivated
Expand Down
2 changes: 1 addition & 1 deletion spec/features/find/maintainance_page_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
visit find_path

expect(page).to have_current_path find_maintenance_path
expect(page).not_to have_content 'This service will be unavailable on'
expect(page).to have_no_content 'This service will be unavailable on'
end
end

Expand Down
2 changes: 1 addition & 1 deletion spec/features/find/maintenance_banner_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@

visit find_path

expect(page).not_to have_content 'This service will be unavailable on'
expect(page).to have_no_content 'This service will be unavailable on'
end
end
end
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def given_i_choose_music

def and_i_provide_my_visa_status
choose 'Yes'
click_button 'Find courses'
click_link_or_button 'Find courses'
end

def then_i_see_that_the_etp_checkbox_is_unchecked
Expand All @@ -60,6 +60,6 @@ def then_i_see_that_the_etp_checkbox_is_unchecked
end

def then_i_dont_see_the_etp_checkbox
expect(find_results_page).not_to have_text('Only show Engineers teach physics courses')
expect(find_results_page).to have_no_text('Only show Engineers teach physics courses')
end
end
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def and_i_select_the_across_england_radio_button
end

def and_i_click_continue
click_button 'Continue'
click_link_or_button 'Continue'
end

def then_i_should_see_the_age_groups_form
Expand All @@ -68,7 +68,7 @@ def when_i_select_my_visa_status
end

def and_i_click_find_courses
click_button 'Find courses'
click_link_or_button 'Find courses'
end

def then_i_should_see_the_find_results_page
Expand Down
6 changes: 3 additions & 3 deletions spec/features/find/search/across_england/primary_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -73,11 +73,11 @@ def and_i_select_the_across_england_radio_button
end

def and_i_click_continue
click_button 'Continue'
click_link_or_button 'Continue'
end

def when_i_click_back
click_link 'Back'
click_link_or_button 'Back'
end

def when_i_click_continue
Expand Down Expand Up @@ -127,7 +127,7 @@ def then_i_should_see_the_subjects_form
end

def and_i_click_find_courses
click_button 'Find courses'
click_link_or_button 'Find courses'
end
alias_method :when_i_click_find_courses, :and_i_click_find_courses

Expand Down
Loading

0 comments on commit bd74f59

Please sign in to comment.