diff --git a/spec/features/cases/foi/link_a_case_spec.rb b/spec/features/cases/foi/link_a_case_spec.rb index 8051055694..6e31641104 100644 --- a/spec/features/cases/foi/link_a_case_spec.rb +++ b/spec/features/cases/foi/link_a_case_spec.rb @@ -16,6 +16,23 @@ kase_1 = create :case link_a_case_step(kase: kase_1) end +end + +feature 'Linking a FOI:IR case to an OverturnedICO:FOI' do + background do + team = find_or_create :team_dacu + bmt_user = team.users.first + login_as bmt_user + end + scenario 'editing a case in drafting state' do + kase_1 = create :accepted_compliance_review + kase_2 = create :overturned_ico_foi + link_a_case_step(kase: kase_1, kase_for_link: kase_2) + end + scenario 'editing a case in unassigned state' do + kase_1 = create :case + link_a_case_step(kase: kase_1) + end end diff --git a/spec/support/features/steps/cases/link_case_steps.rb b/spec/support/features/steps/cases/link_case_steps.rb index 11857e0664..d9aaffc43b 100644 --- a/spec/support/features/steps/cases/link_case_steps.rb +++ b/spec/support/features/steps/cases/link_case_steps.rb @@ -1,5 +1,4 @@ -def link_a_case_step(kase:) - kase_for_link = create :accepted_case +def link_a_case_step(kase:, kase_for_link: create(:accepted_case)) open_cases_page.load click_link kase.number expect(cases_show_page).to be_displayed