Skip to content

Instantly share code, notes, and snippets.

@gabetax
Created August 6, 2013 20:13
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gabetax/6168178 to your computer and use it in GitHub Desktop.
Save gabetax/6168178 to your computer and use it in GitHub Desktop.
module FeatureSpecMacros
module ExampleMethods
def successfully_visit(path)
visit path
successfully_on path
end
def successfully_on(path)
expect(page.current_path).to eq(path), "Expected: #{path} URL\nGot #{page.current_path}\n\nPage source:\n\n#{page.html}"
expect(page.status_code).to eq(200), "Expected: 200 status code\nGot #{page.status_code}\n\nPage source:\n\n#{page.html}"
end
end
end
RSpec.configure do |config|
config.include(FeatureSpecMacros::ExampleMethods, type: :feature)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment