Skip to content
This repository
Browse code

[#204] Remove flash message from users#create

* Flash message is redundant to validation error displayed by
  libraries such as dynamic_form, simple_form, or formtastic.
* We are not bundling one of the form libraries with Clearance
  in order to leave that decision to the developer.
  • Loading branch information...
commit 7184e7d05a848176939abe1d95fc1e9a300ba439 1 parent fd6fbc0
Dan Croak authored July 22, 2012
7  app/controllers/clearance/users_controller.rb
@@ -16,19 +16,12 @@ def create
16 16
       sign_in @user
17 17
       redirect_back_or url_after_create
18 18
     else
19  
-      flash_failure_after_create
20 19
       render :template => 'users/new'
21 20
     end
22 21
   end
23 22
 
24 23
   private
25 24
 
26  
-  def flash_failure_after_create
27  
-    flash.now[:notice] = translate(:bad_email_or_password,
28  
-      :scope   => [:clearance, :controllers, :passwords],
29  
-      :default => "Must be a valid email address. Password can't be blank.")
30  
-  end
31  
-
32 25
   def url_after_create
33 26
     '/'
34 27
   end
4  features/engine/visitor_signs_up.feature
@@ -6,11 +6,11 @@ Feature: Sign up
6 6
 
7 7
   Scenario: Visitor signs up with invalid email
8 8
     When I sign up with "invalidemail" and "password"
9  
-    Then I am told to enter a valid email address
  9
+    Then I should be signed out
10 10
 
11 11
   Scenario: Visitor signs up with blank password
12 12
     When I sign up with "email@example.com" and ""
13  
-    Then I am told to enter a password
  13
+    Then I should be signed out
14 14
 
15 15
   Scenario: Visitor signs up with valid data
16 16
     When I sign up with "email@example.com" and "password"
6  features/step_definitions/engine/clearance_steps.rb
@@ -40,7 +40,7 @@
40 40
 
41 41
 # Sign out
42 42
 
43  
-When "I sign out" do
  43
+When 'I sign out' do
44 44
   visit '/'
45 45
   click_link 'Sign out'
46 46
 end
@@ -107,10 +107,6 @@
107 107
   page.should have_content('Unknown email')
108 108
 end
109 109
 
110  
-Then /^I am told to enter a valid email address$/ do
111  
-  page.should have_content('Must be a valid email address')
112  
-end
113  
-
114 110
 Then /^I am told to enter a password$/ do
115 111
   page.should have_content("Password can't be blank")
116 112
 end

0 notes on commit 7184e7d

Please sign in to comment.
Something went wrong with that request. Please try again.