Skip to content

Commit

Permalink
Fix repeated test issues
Browse files Browse the repository at this point in the history
This fixes issues related to repeated test blocks, context and test
descriptions.
  • Loading branch information
thomasleese committed Jul 2, 2024
1 parent 3574fda commit 7dec74c
Show file tree
Hide file tree
Showing 10 changed files with 11 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
end

describe "GET alternative_name" do
subject(:perform) { get :name_and_date_of_birth }
subject(:perform) { get :alternative_name }

include_examples "redirect unless application form is draft"
end
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@

describe "DELETE destroy" do
subject(:perform) do
get :delete, params: { document_id: document.id, id: upload.id }
delete :delete, params: { document_id: document.id, id: upload.id }
end

let(:document) { create(:document, documentable: application_form) }
Expand Down
7 changes: 0 additions & 7 deletions spec/forms/teacher_interface/qualification_form_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -68,13 +68,6 @@

it { is_expected.not_to be_valid }
end

context "with invalid dates" do
let(:complete_date) { { 1 => 2020, 2 => 1, 3 => 1 } }
let(:certificate_date) { { 1 => 2019, 2 => 1, 3 => 1 } }

it { is_expected.not_to be_valid }
end
end

context "with a country code" do
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
end

context "when confirmed is nil" do
let(:confirmed_no_sanctions) { false }
let(:confirmed_no_sanctions) { nil }

it { is_expected.not_to be_valid }
end
Expand Down
2 changes: 1 addition & 1 deletion spec/lib/application_form_section_status_updater_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@
it { is_expected.to eq("completed") }
end

context "with an incomplete qualification" do
context "with all complete qualifications and part of university degree" do
let(:application_form) do
create(
:application_form,
Expand Down
2 changes: 1 addition & 1 deletion spec/models/application_form_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -421,7 +421,7 @@
end
end

context "with no reminders sent" do
context "with one reminder sent" do
let(:number_of_reminders_sent) { 1 }

it { is_expected.to be false }
Expand Down
4 changes: 2 additions & 2 deletions spec/models/timeline_event_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@
end

context "with a requestable requested event type" do
before { timeline_event.event_type = :requestable_received }
before { timeline_event.event_type = :requestable_requested }

it { is_expected.to validate_absence_of(:assignee) }
it { is_expected.to validate_absence_of(:assessment_section) }
Expand Down Expand Up @@ -392,7 +392,7 @@
end

context "with a requestable verified event type" do
before { timeline_event.event_type = :requestable_reviewed }
before { timeline_event.event_type = :requestable_verified }

it { is_expected.to validate_absence_of(:assignee) }
it { is_expected.to validate_absence_of(:assessment_section) }
Expand Down
4 changes: 2 additions & 2 deletions spec/system/eligibility_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@
then_i_see_the(:eligibility_ineligible_page)
end

it "ineligible path when filtering by country, not qualified in relevant subject" do
it "ineligible path when filtering by eligible country and not qualified in relevant subject" do
when_i_visit_the(:eligibility_start_page)
then_i_see_the(:eligibility_start_page)

Expand Down Expand Up @@ -276,7 +276,7 @@
then_i_see_the(:eligibility_ineligible_page)
end

it "ineligible path when filtering by country, not qualified in relevant subject" do
it "ineligible path when filtering by ineligible country and not qualified in relevant subject" do
when_i_visit_the(:eligibility_start_page)
then_i_see_the(:eligibility_start_page)

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

context "when not passed and not recommended" do
before do
further_information_request.update!(review_passed: true)
further_information_request.update!(review_passed: false)
assessment.request_further_information!
end

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

context "with needs written statement" do
context "with needs registration number" do
let(:needs_registration_number) { true }

it do
Expand Down

0 comments on commit 7dec74c

Please sign in to comment.