Skip to content

Commit

Permalink
Tidy test anomalies (#7462)
Browse files Browse the repository at this point in the history
  • Loading branch information
starswan authored Jan 31, 2025
1 parent b9aee52 commit 7808331
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 5 deletions.
4 changes: 2 additions & 2 deletions spec/models/jobseeker_profile_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
it "does not delete qualifications unrelated to the profile" do
unrelated_qualification = create(:qualification)
profile.replace_qualifications!(new_qualifications)
expect { unrelated_qualification.reload }.not_to raise_error(ActiveRecord::RecordNotFound)
expect { unrelated_qualification.reload }.not_to raise_error
end
end

Expand All @@ -87,7 +87,7 @@
it "does not delete employments unrelated to the profile" do
unrelated_employment = create(:employment)
profile.replace_employments!(new_employments)
expect { unrelated_employment.reload }.not_to raise_error(ActiveRecord::RecordNotFound)
expect { unrelated_employment.reload }.not_to raise_error
end
end
end
2 changes: 1 addition & 1 deletion spec/support/matchers/have_delivered_notification.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
params: (hash_including(expected_params) if expected_params),
}

expect(proc).to change { Noticed::Notification.count }.by(1)
expect { proc.call }.to change { Noticed::Notification.count }.by(1)

notification = Noticed::Notification.last
event = Noticed::Event.find(notification.event_id)
Expand Down
2 changes: 1 addition & 1 deletion spec/support/vacancy_helpers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ def verify_all_vacancy_details(vacancy)
vacancy.working_patterns.each do |working_pattern|
expect(page).to have_content(/#{working_pattern.humanize}/i)
end
expect(page).to have_content(vacancy.working_patterns_details)
expect(page).to have_content(vacancy.working_patterns_details) if vacancy.working_patterns_details.present?

expect(page).to have_content(vacancy.salary) if vacancy.salary_types.include?("full_time")
expect(page).to have_content(vacancy.actual_salary) if vacancy.salary_types.include?("part_time")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,6 @@ def expect_account_to_be_populated_with_old_account_data
visit jobseekers_subscriptions_path

expect(page).not_to have_content "You have no job alerts set up"
expect(page).to have_content subscription.search_criteria["keyword"]
expect(page).to have_content subscription.search_criteria.fetch("keyword", "")
end
end
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@

before { login_publisher(publisher: publisher, organisation: organisation) }

after { logout }

it "shows the current notes" do
visit organisation_job_job_application_path(vacancy.id, job_application)

Expand Down

0 comments on commit 7808331

Please sign in to comment.