|
280 | 280 | fill_in "product_drive_participant_email", with: "123@mail.ru" |
281 | 281 | fill_in "product_drive_participant_comment", with: "test comment" |
282 | 282 | click_on "product-drive-participant-submit" |
| 283 | + expect(page).to have_select('donation_product_drive_participant_id', with_options: ['businesstest']) |
| 284 | + |
283 | 285 | select "businesstest", from: "donation_product_drive_participant_id" |
284 | 286 | end |
285 | 287 |
|
| 288 | + #seems like a duplicate check but this update happens via JS, so we have to test that code works too |
| 289 | + it "Renders ProductDrive Participants sources by business name then contact name after creating a participant" do |
| 290 | + select Donation::SOURCES[:product_drive], from: "donation_source" |
| 291 | + select "---Create new Participant---", from: "donation_product_drive_participant_id" |
| 292 | + |
| 293 | + find(".modal-content") |
| 294 | + expect(page).to have_content("New Product Drive Participant") |
| 295 | + |
| 296 | + fill_in "product_drive_participant_business_name", with: "" |
| 297 | + fill_in "product_drive_participant_contact_name", with: "2nd contact without business name" |
| 298 | + fill_in "product_drive_participant_email", with: "1233@mail.ru" |
| 299 | + fill_in "product_drive_participant_comment", with: "test comment" |
| 300 | + click_on "product-drive-participant-submit" |
| 301 | + |
| 302 | + select ProductDrive.first.name, from: "donation_product_drive_id" |
| 303 | + #note that I'm not explicitly testing the business name here, this is handled in the previous test |
| 304 | + expect(page).to have_select('donation_product_drive_participant_id', with_options: ['2nd contact without business name']) |
| 305 | + end |
| 306 | + |
286 | 307 | it "Allows User to create a donation for a Manufacturer source" do |
287 | 308 | select Donation::SOURCES[:manufacturer], from: "donation_source" |
288 | 309 | expect(page).to have_xpath("//select[@id='donation_manufacturer_id']") |
|
0 commit comments