Skip to content

Commit 4507bee

Browse files
committed
Fix integration tests to work with multiple search setup
When previously a signle no_patient respponse from PDS was enough, we now need to stub the whole flow to return nothing or simply return the correct NHS number in the first request.
1 parent aa3e37a commit 4507bee

7 files changed

+18
-9
lines changed

spec/features/import_child_records_preparation_spec.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,8 @@ def given_today_is_the_start_of_the_2024_25_preparation_period
196196
def and_pds_lookup_during_import_is_enabled
197197
Flipper.enable(:pds_lookup_during_import)
198198

199-
stub_pds_search_to_return_no_patients(
199+
stub_pds_search_to_return_a_patient(
200+
"9990000026",
200201
"family" => "Smith",
201202
"given" => "Jimmy",
202203
"birthdate" => "eq2010-01-02",

spec/features/import_child_records_spec.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,8 @@ def given_the_app_is_setup
140140
def and_pds_lookup_during_import_is_enabled
141141
Flipper.enable(:pds_lookup_during_import)
142142

143-
stub_pds_search_to_return_no_patients(
143+
stub_pds_search_to_return_a_patient(
144+
"9990000026",
144145
"family" => "Smith",
145146
"given" => "Jimmy",
146147
"birthdate" => "eq2010-01-02",

spec/features/import_child_records_with_duplicates_spec.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,8 @@ def and_pds_lookup_during_import_is_enabled
112112

113113
Flipper.enable(:pds_lookup_during_import)
114114

115-
stub_pds_search_to_return_no_patients(
115+
stub_pds_search_to_return_a_patient(
116+
"9990000026",
116117
"family" => "Smith",
117118
"given" => "Jimmy",
118119
"birthdate" => "eq2010-01-02",

spec/features/import_child_records_with_twins_spec.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,8 @@ def given_i_am_signed_in
3636
end
3737

3838
def and_pds_lookup_during_import_returns_nhs_numbers
39-
stub_pds_search_to_return_no_patients(
39+
stub_pds_search_to_return_a_patient(
40+
"9990000026",
4041
"family" => "Smith",
4142
"given" => "Jimmy",
4243
"birthdate" => "eq2010-01-02",

spec/features/import_class_lists_move_spec.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,8 @@ def given_an_hpv_programme_is_underway
8383
def and_pds_lookup_during_import_is_enabled
8484
Flipper.enable(:pds_lookup_during_import)
8585

86-
stub_pds_search_to_return_no_patients(
86+
stub_pds_search_to_return_a_patient(
87+
"9990000026",
8788
"family" => "Smith",
8889
"given" => "Jimmy",
8990
"birthdate" => "eq2010-01-02",

spec/features/import_class_lists_spec.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,8 @@ def given_an_hpv_programme_is_underway
8989
def and_pds_lookup_during_import_is_enabled
9090
Flipper.enable(:pds_lookup_during_import)
9191

92-
stub_pds_search_to_return_no_patients(
92+
stub_pds_search_to_return_a_patient(
93+
"9990000026",
9394
"family" => "Smith",
9495
"given" => "Jimmy",
9596
"birthdate" => "eq2010-01-02",

spec/features/import_class_lists_with_duplicates_spec.rb

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -94,21 +94,24 @@ def given_i_am_signed_in
9494
def and_pds_lookup_during_import_is_enabled
9595
Flipper.enable(:pds_lookup_during_import)
9696

97-
stub_pds_search_to_return_no_patients(
97+
stub_pds_search_to_return_a_patient(
98+
"9990000018",
9899
"family" => "Smith",
99100
"given" => "Jimmy",
100101
"birthdate" => "eq2010-01-01",
101102
"address-postalcode" => "SW1A 1BB"
102103
)
103104

104-
stub_pds_search_to_return_no_patients(
105+
stub_pds_search_to_return_a_patient(
106+
"9990000034",
105107
"family" => "Salles",
106108
"given" => "Rebecca",
107109
"birthdate" => "eq2010-02-03",
108110
"address-postalcode" => "SW1A 3BB"
109111
)
110112

111-
stub_pds_search_to_return_no_patients(
113+
stub_pds_search_to_return_a_patient(
114+
"9990000026",
112115
"family" => "Jones",
113116
"given" => "Sara",
114117
"birthdate" => "eq2010-02-02",

0 commit comments

Comments
 (0)