Created
August 6, 2013 20:13
-
-
Save gabetax/6168178 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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