Skip to content

Instantly share code, notes, and snippets.

@joemsak

joemsak/spec.rb

Created Dec 7, 2017
Embed
What would you like to do?
scenario "Upload 2 .jpg screenshots" do
within(".screenshots.incomplete") do
click_link "Upload screenshots of your app"
end
attach_file(
"Select up to 6 screenshots",
Rails.root + "spec/support/fixtures/screenshot.jpg"
)
click_button "Upload"
within(".screenshots.complete") do
expect(page).not_to have_link("Upload screenshots of your app")
expect(page).to have_content("Your team has uploaded 1 screenshot")
click_link "Make changes to your screenshots"
end
within(find_all(".field--file-upload")[1]) do
attach_file(
"Select up to 6 screenshots",
Rails.root + "spec/support/fixtures/screenshot.jpg"
)
end
click_button "Upload"
within(".screenshots.complete") do
expect(page).to have_content("Your team has uploaded 2 screenshots")
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment