Sha256: 91afc51e7bef8ca737a126ed039f92dd5154dd2d29bfeaa6ba0ac9403f762339

Contents?: true

Size: 883 Bytes

Versions: 4

Compression:

Stored size: 883 Bytes

Contents

Given /^I am signed in as "(.*)"$/ do |email|
  @current_user = User.create!(
    :email => email,
    :password => 'password',
    :password_confirmation => 'password',
    :roles => [Role.create!(:name => 'GeneralUser')]
  )

  Given %{I am on the sign in page}
  When %{I fill in "#{email}" for "Email"}
  And %{I fill in "password" for "Password"}
  And %{I press "Sign in"}
  Then %{I should be on the homepage}
  #And %{I should see "Sign in successful!"}
end

Given /^I have the role "(.*)"$/ do |role|
  @current_user.roles << Role.create!(
    :name => role
    )
  @current_user.save
end

Given /^I only have the role "(.*)"$/ do |role|
  @current_user.roles = [ Role.create!( :name => role) ]
  @current_user.save
end

Given /^I am signed out$/ do
  Given %{I am on the sign out page}
  Then %{I should be on the homepage}
  #And %{I should see "Sign out successful"}
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
devisable-0.2.1 lib/generators/devisable/templates/cucumber/step_definitions/authentication_steps.rb
devisable-0.2.0 lib/generators/devisable/templates/cucumber/step_definitions/authentication_steps.rb
devisable-0.1.3 lib/generators/devisable/templates/cucumber/step_definitions/authentication_steps.rb
devisable-0.1.2 lib/generators/devisable/templates/cucumber/step_definitions/authentication_steps.rb