Permalink
Browse files

Added feature for signing in via the Devise-provided form

  • Loading branch information...
1 parent f87fa45 commit 37539d28b1a5546a06a797156564b14e29ded49e @wycats committed Jun 7, 2011
Showing with 16 additions and 2 deletions.
  1. +1 −0 app/views/layouts/application.html.erb
  2. +13 −2 features/signing_in.feature
  3. +2 −0 features/step_definitions/user_steps.rb
@@ -19,6 +19,7 @@
Signed in as <%= current_user.email %>
<% else %>
<%= link_to "Sign up", new_user_registration_path %>
+ <%= link_to "Sign in", new_user_session_path %>
<% end %>
</nav>
<%= yield %>
@@ -5,10 +5,21 @@ Feature: Signing in
Scenario: Signing in via confirmation
Given there are the following users:
- | email | password |
- | user@ticketee.com | password |
+ | email | password | unconfirmed |
+ | user@ticketee.com | password | true |
And "user@ticketee.com" opens the email with subject "Confirmation instructions"
And they click the first link in the email
Then I should see "Your account was successfully confirmed"
And I should see "Signed in as user@ticketee.com"
+ Scenario: Signing in via form
+ Given there are the following users:
+ | email | password |
+ | user@ticketee.com | password |
+ And I am on the homepage
+ When I follow "Sign in"
+ And I fill in "Email" with "user@ticketee.com"
+ And I fill in "Password" with "password"
+ And I press "Sign in"
+ Then I should see "Signed in successfully."
+
@@ -2,7 +2,9 @@
Given /^there are the following users:$/ do |table|
table.hashes.each do |attributes|
+ unconfirmed = attributes.delete("unconfirmed") == "true"
@user = User.create!(attributes)
+ @user.confirm! unless unconfirmed
end
end

0 comments on commit 37539d2

Please sign in to comment.