Files
growstuff/spec/features/shared_examples/append_date.rb
Brenda Wallace bab9c01bf5 Updating tests
2019-03-29 10:25:30 +13:00

22 lines
642 B
Ruby

shared_examples "append date" do
let(:this_month) { Time.zone.today.strftime("%B") }
let(:this_year) { Time.zone.today.strftime("%Y") }
background { visit path }
scenario "Selecting a date with datepicker" do
click_link link_text
within "div.datepicker" do
expect(page).to have_content this_month.to_s
find(".datepicker-days td.day", text: "21").click
end
expect(page).to have_content "Finished: #{this_month} 21, #{this_year}"
end
scenario "Confirming without selecting date" do
click_link link_text
click_link "Confirm without date"
expect(page).to have_content("Finished")
end
end