Module: ApplicationHelpers

Defined in:
lib/generators/leolay/templates/spec/helpers/application_helpers_spec.rb

Instance Method Summary collapse

Instance Method Details

#login_controller_as(role = :user) ⇒ Object



8
9
10
11
12
# File 'lib/generators/leolay/templates/spec/helpers/application_helpers_spec.rb', line 8

def (role=:user)
  user = Factory(role)
  #user.confirm! # or set a confirmed_at inside the factory. Only necessary if you are using the confirmable module
   user
end

#login_view_as(role = :user) ⇒ Object



2
3
4
5
6
7
# File 'lib/generators/leolay/templates/spec/helpers/application_helpers_spec.rb', line 2

def (role=:user)
  user = Factory(role)
  fill_in 'user_email', :with => user.email
  fill_in 'user_password', :with => user.password
  click_button 'Sign in'
end