Files
growstuff/spec/features/shared_examples/append_date.rb
Brenda Wallace b0c8b11246 📝 Inline editing and display tidy ups (#2200)
* Inline editing and display tidy ups
2019-10-08 11:06:53 +13:00

29 lines
790 B
Ruby

shared_examples "append date" do
let(:this_month) { Time.zone.today.strftime("%b") }
let(:this_year) { Time.zone.today.year }
before { visit path }
describe "Selecting a date with datepicker" do
before do
click_link 'Actions'
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
end
it { expect(page).to have_content "Finished" }
it { expect(page).to have_content "#{this_month} #{this_year}" }
end
describe "Confirming without selecting date" do
before do
click_link 'Actions'
click_link link_text
click_link "Confirm without date"
end
it { expect(page).to have_content("Finished") }
end
end