spec/features/embargo_spec.rb in worthwhile-0.0.2 vs spec/features/embargo_spec.rb in worthwhile-0.0.3

- old
+ new

@@ -8,10 +8,12 @@ describe "creating an embargoed object" do before do visit '/' end + let(:future_date) { 2.days.from_now } + it "can be created, displayed and updated" do click_link 'New Generic Work' fill_in 'Title', with: 'Embargo test' check 'I have read and accept the contributor license agreement' choose 'Embargo' @@ -22,13 +24,13 @@ click_link "Edit This Generic Work" click_link "Embargo Management Page" expect(page).to have_content("This work is under embargo.") - fill_in "until", with: 2.days.from_now.to_s + fill_in "until", with: future_date.to_s click_button "Update Embargo" - expect(page).to have_content(2.days.from_now.strftime '%F') + expect(page).to have_content(future_date.to_date.to_formatted_s(:long_ordinal)) end end describe "managing embargoes" do before do