|
287 | 287 | let(:section_rows) { section[:rows] } |
288 | 288 | let(:all_task_names) { all_sections.flat_map { |section| section[:rows] }.compact.map { |row| row[:task_name] } } |
289 | 289 |
|
290 | | - context "when the daily_submission_emails_enabled feature flag is enabled", :feature_daily_submission_emails_enabled do |
291 | | - context "when the submission type is email" do |
292 | | - it "has link to the submission attachments page" do |
293 | | - expect(section_rows.first[:task_name]).to eq I18n.t("forms.task_list_create.how_you_get_completed_forms_section.optional_subsection.submission_attachments") |
294 | | - expect(section_rows.first[:path]).to eq "/forms/#{form.id}/submission-attachments" |
295 | | - end |
296 | | - |
297 | | - it "has the subsection title 'Optional tasks' as there are multiple tasks" do |
298 | | - expect(section[:title]).to eq I18n.t("forms.task_list.optional_tasks_title.other") |
299 | | - end |
| 290 | + context "when the submission type is email" do |
| 291 | + it "has link to the submission attachments page" do |
| 292 | + expect(section_rows.first[:task_name]).to eq I18n.t("forms.task_list_create.how_you_get_completed_forms_section.optional_subsection.submission_attachments") |
| 293 | + expect(section_rows.first[:path]).to eq "/forms/#{form.id}/submission-attachments" |
300 | 294 | end |
301 | 295 |
|
302 | | - context "when the submission type is s3" do |
303 | | - let(:form) { create(:form, submission_type: "s3") } |
| 296 | + it "has the subsection title 'Optional tasks' as there are multiple tasks" do |
| 297 | + expect(section[:title]).to eq I18n.t("forms.task_list.optional_tasks_title.other") |
| 298 | + end |
| 299 | + end |
304 | 300 |
|
305 | | - it "does not have link to the submission attachments page" do |
306 | | - expect(all_task_names).not_to include I18n.t("forms.task_list_create.how_you_get_completed_forms_section.optional_subsection.submission_attachments") |
307 | | - end |
| 301 | + context "when the submission type is s3" do |
| 302 | + let(:form) { create(:form, submission_type: "s3") } |
308 | 303 |
|
309 | | - it "has the subsection title 'Optional task' as there is only one task" do |
310 | | - expect(section[:title]).to eq I18n.t("forms.task_list.optional_tasks_title.one") |
311 | | - end |
| 304 | + it "does not have link to the submission attachments page" do |
| 305 | + expect(all_task_names).not_to include I18n.t("forms.task_list_create.how_you_get_completed_forms_section.optional_subsection.submission_attachments") |
312 | 306 | end |
313 | 307 |
|
314 | | - it "has link to the daily submission batch page" do |
315 | | - expect(section_rows.second[:task_name]).to eq I18n.t("forms.task_list_create.how_you_get_completed_forms_section.optional_subsection.daily_submission_batch") |
316 | | - expect(section_rows.second[:path]).to eq "/forms/#{form.id}/daily-submission-csv" |
| 308 | + it "has the subsection title 'Optional task' as there is only one task" do |
| 309 | + expect(section[:title]).to eq I18n.t("forms.task_list.optional_tasks_title.one") |
317 | 310 | end |
318 | 311 | end |
319 | 312 |
|
320 | | - context "when the daily_submission_emails_enabled feature flag is disabled", feature_daily_submission_emails_enabled: false do |
321 | | - it "does not have link to the daily submission batch page" do |
322 | | - expect(all_task_names).not_to include I18n.t("forms.task_list_create.how_you_get_completed_forms_section.optional_subsection.daily_submission_batch") |
323 | | - end |
324 | | - |
325 | | - context "when the submission type is s3" do |
326 | | - let(:form) { create(:form, submission_type: "s3") } |
327 | | - |
328 | | - it "does not include the optional tasks subsection at all" do |
329 | | - expect(section[:title]).to eq I18n.t("forms.task_list_create.privacy_and_contact_details_section.title") |
330 | | - end |
331 | | - end |
| 313 | + it "has link to the daily submission batch page" do |
| 314 | + expect(section_rows.second[:task_name]).to eq I18n.t("forms.task_list_create.how_you_get_completed_forms_section.optional_subsection.daily_submission_batch") |
| 315 | + expect(section_rows.second[:path]).to eq "/forms/#{form.id}/daily-submission-csv" |
332 | 316 | end |
333 | 317 | end |
334 | 318 |
|
|
525 | 509 | end |
526 | 510 | end |
527 | 511 |
|
528 | | - context "when editing an existing form", :feature_daily_submission_emails_enabled do |
| 512 | + context "when editing an existing form" do |
529 | 513 | let(:form) { create(:form, :live) } |
530 | 514 | let(:group) { create(:group, :with_welsh_enabled, name: "Group 1", organisation:, status: group_status) } |
531 | 515 | let(:can_make_form_live) { true } |
|
0 commit comments