Skip to content

Commit cd48322

Browse files
committed
test: add system spec for creating Donation Site from donation form
1 parent bd9ba18 commit cd48322

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

spec/system/donation_system_spec.rb

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -360,6 +360,19 @@
360360
end.to change { Donation.count }.by(1)
361361
end
362362

363+
it "Allows User to create a Donataion Site from donation" do
364+
select Donation::SOURCES[:donation_site], from: "donation_source"
365+
select "---Create New Donation site---", from: "donation_donation_site_id"
366+
367+
find(".modal-content")
368+
expect(page).to have_content("New Donation Site")
369+
370+
fill_in "donation_site_name", with: "Test Donation Site"
371+
fill_in "donation_site_address", with: "Test Address"
372+
within(".modal-content") { click_button "Save" }
373+
select "Test Donation Site", from: "donation_donation_site_id"
374+
end
375+
363376
it "Allows User to create a donation with a Miscellaneous source" do
364377
select Donation::SOURCES[:misc], from: "donation_source"
365378
expect(page).not_to have_xpath("//select[@id='donation_donation_site_id']")

0 commit comments

Comments
 (0)