added RSpec support things
This commit is contained in:
parent
2cc0e1c52c
commit
1f8de9cd78
|
@ -0,0 +1,3 @@
|
|||
RSpec.configure do |config|
|
||||
config.include Devise::TestHelpers, type: :controller
|
||||
end
|
|
@ -0,0 +1,5 @@
|
|||
require 'support/helpers/session_helpers'
|
||||
|
||||
RSpec.configure do |config|
|
||||
config.include Features::SessionHelpers, type: :feature
|
||||
end
|
|
@ -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
|
Loading…
Reference in New Issue