|
27 | 27 |
|
28 | 28 | click_on "Submit" |
29 | 29 |
|
30 | | - case_contact.reload |
31 | 30 | expect(page).to have_text "Case contact created at #{case_contact.created_at.strftime("%-I:%-M %p on %m-%e-%Y")}, was successfully updated." |
| 31 | + case_contact.reload |
32 | 32 | expect(case_contact.casa_case_id).to eq casa_case.id |
33 | 33 | expect(case_contact.duration_minutes).to eq 105 |
34 | 34 | expect(case_contact.medium_type).to eq "letter" |
35 | 35 | expect(case_contact.contact_made).to be true |
36 | 36 | end |
37 | 37 |
|
38 | | - # TODO: Fix this test |
39 | | - xit "admin successfully edits case contact with mileage reimbursement" do |
| 38 | + it "admin successfully edits case contact with mileage reimbursement" do |
40 | 39 | visit edit_case_contact_path(case_contact) |
41 | 40 |
|
42 | 41 | complete_details_page(case_numbers: [], contact_types: [], contact_made: true, medium: "In Person", hours: 1, minutes: 45, occurred_on: "04/04/2020") |
43 | 42 | complete_notes_page |
44 | 43 | fill_in_expenses_page(miles: 10, want_reimbursement: true, address: "123 str") |
45 | 44 |
|
46 | 45 | click_on "Submit" |
47 | | - case_contact.reload |
48 | 46 | expect(page).to have_text "Case contact created at #{case_contact.created_at.strftime("%-I:%-M %p on %m-%e-%Y")}, was successfully updated." |
| 47 | + case_contact.reload |
| 48 | + volunteer.address&.reload |
49 | 49 | expect(case_contact.casa_case.volunteers[0]).to eq volunteer |
50 | 50 | expect(volunteer.address&.content).to eq "123 str" |
51 | 51 | expect(case_contact.casa_case_id).to eq casa_case.id |
|
63 | 63 | visit edit_case_contact_path(case_contact) |
64 | 64 |
|
65 | 65 | complete_details_page(case_numbers: [], contact_types: [], contact_made: true, medium: "In Person", hours: 1, minutes: 45, occurred_on: "04/04/2020") |
66 | | - complete_notes_page |
67 | 66 |
|
68 | 67 | check "Request travel or other reimbursement" |
69 | 68 | expect(page).to have_field("case_contact_volunteer_address", disabled: true) |
70 | 69 | expect(page).to have_text("There are two or more volunteers assigned to this case and you are trying to set the address for both of them. This is not currently possible.") |
71 | | - |
72 | | - click_on "Submit" |
73 | | - expect(case_contact.reload.volunteer_address).to be_blank |
74 | 70 | end |
75 | 71 |
|
76 | 72 | context "when user is part of a different organization" do |
|
112 | 108 | fill_in_expenses_page(miles: 50, want_reimbursement: true, address: "123 Form St") |
113 | 109 | click_on "Submit" |
114 | 110 |
|
115 | | - case_contact.reload |
116 | 111 | expect(page).to have_text "Case contact created at #{case_contact.created_at.strftime("%-I:%-M %p on %m-%e-%Y")}, was successfully updated." |
| 112 | + case_contact.reload |
| 113 | + case_contact.contact_topic_answers&.reload |
117 | 114 | expect(case_contact.duration_minutes).to eq 65 |
118 | 115 | expect(case_contact.medium_type).to eq "letter" |
119 | 116 | expect(case_contact.contact_made).to be true |
|
128 | 125 | expect(case_contact.volunteer_address).to eq "123 Form St" |
129 | 126 | end |
130 | 127 |
|
131 | | - xit "is successful with mileage reimbursement on" do # TODO make test not flaky |
| 128 | + it "is successful with mileage reimbursement on" do |
132 | 129 | visit edit_case_contact_path(case_contact) |
133 | 130 |
|
134 | 131 | complete_details_page(contact_made: true, medium: "In Person", hours: 1, minutes: 45, occurred_on: "04/04/2020") |
|
137 | 134 |
|
138 | 135 | click_on "Submit" |
139 | 136 |
|
| 137 | + expect(page).to have_text "Case contact created at #{case_contact.created_at.strftime("%-I:%-M %p on %m-%e-%Y")}, was successfully updated." |
140 | 138 | case_contact.reload |
141 | 139 | volunteer.reload |
142 | | - expect(page).to have_text "Case contact created at #{case_contact.created_at.strftime("%-I:%-M %p on %m-%e-%Y")}, was successfully updated." |
143 | 140 | expect(volunteer.address.content).to eq "123 str" |
144 | 141 | expect(case_contact.casa_case_id).to eq casa_case.id |
145 | 142 | expect(case_contact.duration_minutes).to eq 105 |
|
0 commit comments