Skip to content

Instantly share code, notes, and snippets.

@IdahoEv
Created January 28, 2015 23:34
Show Gist options
  • Select an option

  • Save IdahoEv/572477e38ee93c152510 to your computer and use it in GitHub Desktop.

Select an option

Save IdahoEv/572477e38ee93c152510 to your computer and use it in GitHub Desktop.
Finished in 34.57 seconds (files took 2.93 seconds to load)
111 examples, 2 failures, 1 pending
Failed examples:
rspec ./spec/features/visitor_navigates_with_menu_spec.rb:19 # Vistor navigated to a path on desktop click on Path Link
rspec /Users/evan/.rvm/gems/ruby-2.1.2@cms2/gems/rspec-steps-1.0.7/lib/rspec-steps/stepwise.rb:17 # Vistor navigated to a path on desktop step list
Failures:
1) Vistor navigated to a path on desktop click on Path Link
Failure/Error: click_on("Path Link")
Capybara::ElementNotFound:
Unable to find link or button "Path Link"
# ./spec/features/visitor_navigates_with_menu_spec.rb:20:in `block (2 levels) in <top (required)>'
2) Vistor navigated to a path on desktop step list
Failure/Error: example.run(self, reporter)
Capybara::ElementNotFound:
Unable to find link or button "Path Link"
# ./spec/features/visitor_navigates_with_menu_spec.rb:20:in `block (2 levels) in <top (required)>'
require 'spec_helper'
shared_steps "Setup for navigation" do
before :all do
@page_one = FactoryGirl.create(:one_column_page)
@page_two = FactoryGirl.create(:two_column_page)
@page_link = FactoryGirl.create(:menu_item, name: 'Page Link', page: @page_one)
@path_link = FactoryGirl.create(:menu_item_without_page, name: "Path Link", path: '/#/sign-in')
end
end
steps "Vistor navigated to a path on desktop", :js => true, :size => :desktop do
perform_steps "Setup for navigation"
it "visit root" do
visit '/'
end
it "click on Path Link" do
click_on("Path Link")
end
it "should have right content" do
expect(page).to have_content("Sign In")
expect(URI(current_url).path).to eq('/sign-in')
end
end
steps "Vistor navigated to a page on desktop", :js => true, :size => :desktop do
perform_steps "Setup for navigation"
it "visit root" do
visit '/'
end
it "clicks on Page Link" do
click_on("Page Link")
end
it "should have right content" do
expect(page).to have_content(@page_one.contents["headline"].body)
expect(page.body).to include(@page_one.contents["main"].body)
expect(URI(current_url).path).to eq("/pages/" + @page_one.url_slug)
end
end
steps "Vistor navigated to a path on mobile", :js => true, :size => :mobile do
perform_steps "Setup for navigation"
it "visit root" do
visit '/'
end
it "clicks on Menu" do
click_on("Menu") # Expand the currently-collapsed menu
end
it "clicks on Path Link" do
click_on("Path Link")
end
it "should have right content" do
expect(page).to have_content("Sign In")
expect(URI(current_url).path).to eq('/sign-in')
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment