Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement or remove pending tests #4803

Merged
merged 20 commits into from
Apr 7, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Prev Previous commit
Next Next commit
Implement pending card image expectations
  • Loading branch information
javierm committed Apr 7, 2022
commit c5791278b2ac1db12121599c1dc5d41e4f205746
15 changes: 13 additions & 2 deletions spec/system/admin/widgets/cards_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,19 @@
end
end

scenario "Show image if it is present" do
card_1 = create(:widget_card, cardable: custom_page, title: "Card one")
card_2 = create(:widget_card, cardable: custom_page, title: "Card two")

card_1.update!(image: create(:image, imageable: card_1, attachment: fixture_file_upload("clippy.jpg")))
javierm marked this conversation as resolved.
Show resolved Hide resolved
card_2.update!(image: nil)

visit custom_page.url

within(".card", text: "CARD ONE") { expect(page).to have_css "img" }
within(".card", text: "CARD TWO") { expect(page).not_to have_css "img" }
end

scenario "Edit" do
create(:widget_card, cardable: custom_page, title: "Original title")

Expand Down Expand Up @@ -247,8 +260,6 @@
end
end

pending "add image expectactions"

def attach_image_to_card
click_link "Add image"
attach_file "Choose image", file_fixture("clippy.jpg")
Expand Down