added RSpec support things

This commit is contained in:
nilsding 2014-12-07 12:41:42 +01:00
parent 2cc0e1c52c
commit 1f8de9cd78
3 changed files with 27 additions and 0 deletions

3
spec/support/devise.rb Normal file
View File

@ -0,0 +1,3 @@
RSpec.configure do |config|
config.include Devise::TestHelpers, type: :controller
end

5
spec/support/helpers.rb Normal file
View File

@ -0,0 +1,5 @@
require 'support/helpers/session_helpers'
RSpec.configure do |config|
config.include Features::SessionHelpers, type: :feature
end

View File

@ -0,0 +1,19 @@
module Features
module SessionHelpers
def sign_up_with(screen_name, email, password, confirmation)
visit new_user_registration_path
fill_in 'User name', with: screen_name
fill_in 'Email address', with: email
fill_in 'Password', with: password
fill_in 'Password confirmation', :with => confirmation
click_button 'Sign up'
end
def signin(email, password)
visit new_user_session_path
fill_in 'User name', with: email
fill_in 'Password', with: password
click_button 'Sign in'
end
end
end