Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

[#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 croaky authored
7 app/controllers/clearance/users_controller.rb
View
@@ -16,19 +16,12 @@ def create
sign_in @user
redirect_back_or url_after_create
else
- flash_failure_after_create
render :template => 'users/new'
end
end
private
- def flash_failure_after_create
- flash.now[:notice] = translate(:bad_email_or_password,
- :scope => [:clearance, :controllers, :passwords],
- :default => "Must be a valid email address. Password can't be blank.")
- end
-
def url_after_create
'/'
end
4 features/engine/visitor_signs_up.feature
View
@@ -6,11 +6,11 @@ Feature: Sign up
Scenario: Visitor signs up with invalid email
When I sign up with "invalidemail" and "password"
- Then I am told to enter a valid email address
+ Then I should be signed out
Scenario: Visitor signs up with blank password
When I sign up with "email@example.com" and ""
- Then I am told to enter a password
+ Then I should be signed out
Scenario: Visitor signs up with valid data
When I sign up with "email@example.com" and "password"
6 features/step_definitions/engine/clearance_steps.rb
View
@@ -40,7 +40,7 @@
# Sign out
-When "I sign out" do
+When 'I sign out' do
visit '/'
click_link 'Sign out'
end
@@ -107,10 +107,6 @@
page.should have_content('Unknown email')
end
-Then /^I am told to enter a valid email address$/ do
- page.should have_content('Must be a valid email address')
-end
-
Then /^I am told to enter a password$/ do
page.should have_content("Password can't be blank")
end
Please sign in to comment.
Something went wrong with that request. Please try again.