Skip to content

Commit

Permalink
Add feature helpers
Browse files Browse the repository at this point in the history
  • Loading branch information
Sinetheta committed Apr 29, 2016
1 parent e3b8653 commit 08202a3
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
2 changes: 2 additions & 0 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,6 @@

# because database cleaner
config.use_transactional_fixtures = false

config.include FeatureHelper, type: :feature
end
10 changes: 10 additions & 0 deletions spec/support/feature_helper.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
module FeatureHelper
def login_as_admin
admin = create(:admin_user, password: 'test123', password_confirmation: 'test123')
visit spree.admin_path
fill_in 'Email', with: admin.email
fill_in 'Password', with: 'test123'
click_button 'Login'
admin
end
end

0 comments on commit 08202a3

Please sign in to comment.