Created
February 12, 2014 02:27
-
-
Save cupakromer/8948898 to your computer and use it in GitHub Desktop.
This file contains 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
# spec/support/feature_sigin_helpers.rb | |
# Just some useful namespace | |
module KrackenFeatures | |
module SignInHelpers | |
def sign_in(person) | |
visit new_user_session_path | |
fill_in 'Email', with: person.email | |
fill_in 'Password', with: person.password | |
click_button 'Sign in' | |
end | |
end | |
end | |
# Manually include per feature spec | |
require 'spec_helper' | |
feature 'Placing an order' do | |
include KrackenFeatures::SignInHelpers | |
given(:john_smith) { } | |
# stuff | |
end | |
# If you wish to use metadata instead | |
# spec/spec_helper.rb | |
# stuff | |
RSpec.configure do |config| | |
# stuff | |
config.include KrackenFeatures::SignInHelpers, signinable: true | |
end | |
# then in the spec file | |
feature 'Placing an order', :signinable do | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment