Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Encourage people to sign up in the flash message #199

Merged
merged 1 commit into from

2 participants

@gabebw
Owner

Fixes #163.

Arun Agrawal and Gabe Berke-Williams Encourage people to sign up in the flash message
Fixes #163.
b9cf234
@mike-burns mike-burns merged commit b9cf234 into master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Jun 13, 2012
  1. @gabebw

    Encourage people to sign up in the flash message

    Arun Agrawal and Gabe Berke-Williams authored gabebw committed
    Fixes #163.
This page is out of date. Refresh to see the latest.
View
2  app/controllers/clearance/sessions_controller.rb
@@ -29,7 +29,7 @@ def destroy
def flash_failure_after_create
flash.now[:notice] = translate(:bad_email_or_password,
:scope => [:clearance, :controllers, :sessions],
- :default => "Bad email or password.")
+ :default => %{Bad email or password. Are you trying to register a new account? <a href="#{sign_up_path}">Sign up</a>.}.html_safe)
end
def url_after_create
View
7 features/engine/visitor_signs_in.feature
@@ -24,3 +24,10 @@ Feature: Sign in
Given I am signed up as "email@example.com"
When I sign in as "Email@example.com"
Then I should be signed in
+
+ Scenario: Visitor enters wrong password and goes to sign up
+ Given I am signed up as "email@example.com"
+ When I sign in as "email@example.com" and "badpassword"
+ Then I am told email or password is bad
+ When I follow the sign up link in the flash
+ Then I should be on the sign up page
View
14 features/step_definitions/engine/clearance_steps.rb
@@ -93,10 +93,22 @@
click_button "Save this password"
end
+# Navigation
+
+Then /^I should be on the sign up page$/ do
+ page.current_path.should == sign_up_path
+end
+
# Flashes
Then /^I am told email or password is bad$/ do
- page.should have_content("Bad email or password")
+ page.should have_content("Bad email or password. Are you trying to register a new account? Sign up.")
+end
+
+When /^I follow the sign up link in the flash$/ do
+ within '#flash' do
+ click_link 'Sign up'
+ end
end
Then /^I am told email is unknown$/ do
Something went wrong with that request. Please try again.