diff --git a/spec/system/admin/site_customization/documents_spec.rb b/spec/system/admin/site_customization/documents_spec.rb index ce7c236b8..92d2e543a 100644 --- a/spec/system/admin/site_customization/documents_spec.rb +++ b/spec/system/admin/site_customization/documents_spec.rb @@ -58,7 +58,7 @@ describe "Documents", :admin do click_button "Upload" expect(page).to have_content "Document uploaded succesfully" - expect(page).to have_link "logo.pdf", href: Document.last.attachment.url + expect(page).to have_link "logo.pdf" end scenario "Errors on create" do diff --git a/spec/system/admin/widgets/cards_spec.rb b/spec/system/admin/widgets/cards_spec.rb index 51e37f965..fae155352 100644 --- a/spec/system/admin/widgets/cards_spec.rb +++ b/spec/system/admin/widgets/cards_spec.rb @@ -40,19 +40,18 @@ describe "Cards", :admin do end scenario "Index" do - 3.times { create(:widget_card) } + cards = Array.new(3) { create(:widget_card) } visit admin_homepage_path expect(page).to have_css(".homepage-card", count: 3) - cards = Widget::Card.all cards.each do |card| expect(page).to have_content card.title expect(page).to have_content card.description expect(page).to have_content card.link_text expect(page).to have_content card.link_url - expect(page).to have_link("Show image", href: card.image_url(:large)) + expect(page).to have_link "Show image" end end