diff options
-rw-r--r-- | README | 4 | ||||
-rw-r--r-- | app/controllers/user_controller.rb | 6 | ||||
-rw-r--r-- | spec/controllers/user_controller_spec.rb | 5 | ||||
-rw-r--r-- | todo.txt | 24 |
4 files changed, 15 insertions, 24 deletions
@@ -174,8 +174,8 @@ script Helper scripts for automation and generation. spec - Unit and functional specifications along with fixtures. We use this instead of - test. + Unit and functional specifications along with fixtures, using rspec. We use + this instead of test. test DEPRECATED for this project, see 'spec' instead. Unit and functional tests diff --git a/app/controllers/user_controller.rb b/app/controllers/user_controller.rb index 75f78c97f..4888bbbce 100644 --- a/app/controllers/user_controller.rb +++ b/app/controllers/user_controller.rb @@ -4,11 +4,15 @@ # Copyright (c) 2007 UK Citizens Online Democracy. All rights reserved. # Email: francis@mysociety.org; WWW: http://www.mysociety.org/ # -# $Id: user_controller.rb,v 1.15 2007-11-07 10:45:44 francis Exp $ +# $Id: user_controller.rb,v 1.16 2007-11-08 12:57:01 francis Exp $ class UserController < ApplicationController # XXX See controllers/application.rb simplify_url_part for reverse of expression in SQL below def show + if simplify_url_part(params[:simple_name]) != params[:simple_name] + redirect_to :simple_name => simplify_url_part(params[:simple_name]) + end + @display_users = User.find(:all, :conditions => [ "regexp_replace(replace(lower(name), ' ', '-'), '[^a-z0-9_-]', '', 'g') = ?", params[:simple_name] ], :order => "created_at desc") end diff --git a/spec/controllers/user_controller_spec.rb b/spec/controllers/user_controller_spec.rb index 239b7cf56..432c56bb7 100644 --- a/spec/controllers/user_controller_spec.rb +++ b/spec/controllers/user_controller_spec.rb @@ -8,6 +8,11 @@ describe UserController, "when showing a user" do response.should be_success end + it "should redirect to lower case name if given one with capital letters" do + get :show, :simple_name => "Bob_Smith" + response.should redirect_to(:controller => 'user', :action => 'show', :simple_name => "bob_smith") + end + it "should render with 'show' template" do get :show, :simple_name => "bob_smith" response.should render_template('show') @@ -9,31 +9,13 @@ Send email to requestor telling them new information has come in Forgotten password link Email has already been taken hasn't got a link to better place Link from error page for signin/signup to go to other one +Remember me box Make it say "dear" as default letter -Work out how to do controller/view integrated specs and add some +Work out how to get it to tell you code coverage of .rhtml files Make it validate the HTML - -Make login have wording like on PledgeBank - Do you have a PledgeBank password? - Yes, please enter it: - No, or you’ve forgotten it - — we’ll send you a confirmation email instead. - - - UST ONE MORE THING YOU HAVE TO DO! - - You are now a bbc.co.uk member. - However, we need to confirm that frabcus@fastmail.fm is your email address. - If your email address is not correct you can go to your membership details to change it. Retrieve my details - 1. Check your inbox now, we have sent you an email to which you must respond. - 2. Just follow the instructions in our email. - 3. You can leave this page now knowing that we have all your details safely stored. - - What if I don't receive the email? - -Use word verify + maybe with http://www.anodyne.ca/wp-content/uploads/2007/09/be_valid_xhtml.rb Tidying ======= |