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

added feature_spec_helper to turn on javascript driver, added test fo… #132

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 13 additions & 2 deletions spec/features/browsing_spec.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
require "rails_helper"
require "features_helper"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you forget to commit this file? It doesn't exist in the project.

https://travis-ci.org/rubyforgood/playtime/builds/288863689

require "support/omniauth"

feature "Browsing the site:" do
Expand All @@ -24,7 +24,7 @@

context "when there are wishlist items" do
before do
create(:item, :on_a_wishlist, wishlist: dc_general, name: "BatCorgi!")
create(:item, :on_a_wishlist, wishlist: dc_general, name: "BatCorgi!", amazon_url: "https://www.amazon.com")
create(:item, :on_a_wishlist, wishlist: st_josephs, name: "Puzzles")
end

Expand All @@ -36,6 +36,17 @@
expect(page).to have_button "Pledge to Donate"
end

scenario "I can open a new tab to pledge", js: true do
visit "/"

expect(page).to have_text "BatCorgi!"

new_window = window_opened_by { all('input[value="Pledge to Donate"]').first.click }
new_window.close

expect(page).to have_text "Pledge was successfully created."
end

scenario "I can see a list of items for a given wishlist" do
visit "/"
click_link "DC General"
Expand Down