|
74 | 74 | team_name: "Organisation", |
75 | 75 | team_phone: "01234 567890 (option 1)", |
76 | 76 | vaccination: "HPV vaccination", |
| 77 | + vaccine_is_injection: "no", |
| 78 | + vaccine_is_nasal: "no", |
77 | 79 | vaccine_side_effects: "" |
78 | 80 | } |
79 | 81 | ) |
|
243 | 245 | end |
244 | 246 | end |
245 | 247 |
|
| 248 | + context "with vaccine methods" do |
| 249 | + context "and an injection-only programme" do |
| 250 | + before do |
| 251 | + create( |
| 252 | + :patient_consent_status, |
| 253 | + :given, |
| 254 | + patient:, |
| 255 | + programme: programmes.first |
| 256 | + ) |
| 257 | + end |
| 258 | + |
| 259 | + it { should include(vaccine_is_injection: "yes", vaccine_is_nasal: "no") } |
| 260 | + end |
| 261 | + |
| 262 | + context "and a nasal spray programme" do |
| 263 | + let(:programmes) { [create(:programme, :flu)] } |
| 264 | + |
| 265 | + before do |
| 266 | + create( |
| 267 | + :patient_consent_status, |
| 268 | + :given, |
| 269 | + patient:, |
| 270 | + programme: programmes.first, |
| 271 | + vaccine_methods: %w[nasal injection] |
| 272 | + ) |
| 273 | + end |
| 274 | + |
| 275 | + it { should include(vaccine_is_injection: "no", vaccine_is_nasal: "yes") } |
| 276 | + end |
| 277 | + |
| 278 | + context "and multiple programmes" do |
| 279 | + let(:programmes) { [create(:programme, :hpv), create(:programme, :flu)] } |
| 280 | + |
| 281 | + before do |
| 282 | + create( |
| 283 | + :patient_consent_status, |
| 284 | + :given, |
| 285 | + patient:, |
| 286 | + programme: programmes.first, |
| 287 | + vaccine_methods: %w[nasal injection] |
| 288 | + ) |
| 289 | + create( |
| 290 | + :patient_consent_status, |
| 291 | + :given, |
| 292 | + patient:, |
| 293 | + programme: programmes.second |
| 294 | + ) |
| 295 | + end |
| 296 | + |
| 297 | + it do |
| 298 | + expect(to_h).to include( |
| 299 | + vaccine_is_injection: "yes", |
| 300 | + vaccine_is_nasal: "yes" |
| 301 | + ) |
| 302 | + end |
| 303 | + end |
| 304 | + end |
| 305 | + |
246 | 306 | context "with vaccine side effects" do |
247 | 307 | before do |
248 | 308 | programmes.first.vaccines.first.update!(side_effects: %w[swelling unwell]) |
|
0 commit comments