|
43 | 43 | all("input[type='submit'][value='Save Progress']").last.click |
44 | 44 | expect(page).to have_css(".alert-success", text: "Details were successfully updated.") |
45 | 45 |
|
46 | | - # Submit for Approval |
47 | | - expect(page).to have_link("Submit Profile for Approval", href: partners_approval_request_path) |
48 | | - first(:link, "Submit Profile for Approval").click |
| 46 | + # Submit and Review |
| 47 | + all("input[type='submit'][value='Save and Review']").last.click |
49 | 48 | expect(current_path).to eq(partners_profile_path) |
50 | | - expect(page).to have_css(".alert-success", text: "You have submitted your details for approval.") |
51 | | - expect(page).to have_css(".badge", text: "Awaiting Review") |
| 49 | + expect(page).to have_css(".alert-success", text: "Details were successfully updated.") |
52 | 50 | end |
53 | 51 |
|
54 | 52 | it "displays the edit view with sections containing validation errors expanded" do |
|
86 | 84 | expect(page).to have_css("#pick_up_person.accordion-collapse.collapse.show", visible: true) |
87 | 85 | expect(page).to have_css("#partner_settings.accordion-collapse.collapse.show", visible: true) |
88 | 86 |
|
89 | | - # Submit for Approval is still enabled |
90 | | - expect(page).to have_link("Submit Profile for Approval", href: partners_approval_request_path) |
| 87 | + # Try to Submit and Review from error state |
| 88 | + all("input[type='submit'][value='Save and Review']").last.click |
| 89 | + |
| 90 | + # Expect an alert-danger message containing validation errors |
| 91 | + expect(page).to have_css(".alert-danger", text: /There is a problem/) |
| 92 | + expect(page).to have_content("No social media presence must be checked if you have not provided any of Website, Twitter, Facebook, or Instagram.") |
| 93 | + expect(page).to have_content("Enable child based requests At least one request type must be set") |
| 94 | + expect(page).to have_content("Pick up email can't have more than three email addresses") |
| 95 | + |
| 96 | + # Expect media section, executive director section, and partner settings section to be opened |
| 97 | + expect(page).to have_css("#media_information.accordion-collapse.collapse.show", visible: true) |
| 98 | + expect(page).to have_css("#pick_up_person.accordion-collapse.collapse.show", visible: true) |
| 99 | + expect(page).to have_css("#partner_settings.accordion-collapse.collapse.show", visible: true) |
91 | 100 | end |
92 | 101 | end |
93 | 102 | end |
0 commit comments