|
36 | 36 | ]) |
37 | 37 | end |
38 | 38 | let(:form_with_a_few_answer_types) do |
39 | | - create(:form, :live, submission_type: "email", submission_format: %w[csv json], send_daily_submission_batch: true, |
40 | | - pages: [ |
41 | | - create(:page, answer_type: "email"), |
42 | | - *create_list(:page, 3, answer_type: "name"), |
43 | | - ]) |
| 39 | + create(:form, |
| 40 | + :live, |
| 41 | + submission_type: "email", |
| 42 | + submission_format: %w[csv json], |
| 43 | + send_daily_submission_batch: true, |
| 44 | + send_weekly_submission_batch: true, |
| 45 | + pages: [ |
| 46 | + create(:page, answer_type: "email"), |
| 47 | + *create_list(:page, 3, answer_type: "name"), |
| 48 | + ]) |
44 | 49 | end |
45 | 50 | let(:branch_route_form) do |
46 | 51 | form = create(:form, :live, :ready_for_routing, submission_type: "s3", submission_format: %w[csv]) |
|
85 | 90 | forms_with_csv_submission_email_attachments: 2, |
86 | 91 | forms_with_json_submission_email_attachments: 1, |
87 | 92 | forms_with_daily_submission_csv: 1, |
| 93 | + forms_with_weekly_submission_csv: 1, |
88 | 94 | forms_with_s3_submissions: 1, |
89 | 95 | forms_with_answer_type: { |
90 | 96 | "address" => 1, |
|
446 | 452 | end |
447 | 453 | end |
448 | 454 |
|
| 455 | + describe "#forms_with_weekly_submission_csv" do |
| 456 | + it "returns live forms with weekly submission csv enabled" do |
| 457 | + forms = described_class.new(form_documents).forms_with_weekly_submission_csv |
| 458 | + expect(forms.length).to eq 1 |
| 459 | + expect(forms).to match [ |
| 460 | + a_hash_including( |
| 461 | + "form_id" => form_with_a_few_answer_types.id, |
| 462 | + "content" => a_hash_including( |
| 463 | + "name" => form_with_a_few_answer_types.name, |
| 464 | + ), |
| 465 | + ), |
| 466 | + ] |
| 467 | + end |
| 468 | + end |
| 469 | + |
449 | 470 | describe "#forms_with_s3_submissions" do |
450 | 471 | it "returns live forms with json enabled" do |
451 | 472 | forms = described_class.new(form_documents).forms_with_s3_submissions |
|
0 commit comments