diff options
-rw-r--r-- | app/views/user/sign.rhtml | 13 | ||||
-rw-r--r-- | spec/controllers/user_controller_spec.rb | 5 |
2 files changed, 5 insertions, 13 deletions
diff --git a/app/views/user/sign.rhtml b/app/views/user/sign.rhtml index afdb90162..bfd0fa63e 100644 --- a/app/views/user/sign.rhtml +++ b/app/views/user/sign.rhtml @@ -1,4 +1,4 @@ -<% if @post_redirect.reason_params[:user_name] %> +<% if !@post_redirect.nil? && @post_redirect.reason_params[:user_name] %> <% @title = _("Sign in") %> <div id="sign_alone"> @@ -19,16 +19,7 @@ <% else %> <% @title = _('Sign in or make a new account') %> - <div id="sign_together"> - - <!--<p id="sign_in_reason"> - <% if @post_redirect.reason_params[:web].empty? %> - <%= _(' Please sign in or make a new account.') %> - <% else %> - <%= @post_redirect.reason_params[:web] %>, <%= _('please sign in or make a new account.') %> - <% end %> - </p>--> - + <div id="sign_together"> <div id="left_half"> <h1><%= _('Sign in') %></h1> <%= render :partial => 'signin', :locals => { :sign_in_as_existing_user => false } %> diff --git a/spec/controllers/user_controller_spec.rb b/spec/controllers/user_controller_spec.rb index 2560b48c7..30ad61706 100644 --- a/spec/controllers/user_controller_spec.rb +++ b/spec/controllers/user_controller_spec.rb @@ -111,15 +111,16 @@ describe UserController, "when signing in" do it "should not log you in if you use an invalid PostRedirect token, and shouldn't give 500 error either" do ActionController::Routing::Routes.filters.clear - get :signin, :r => "/list" - response.should render_template('sign') post_redirect = "something invalid" lambda { post :signin, { :user_signin => { :email => 'bob@localhost', :password => 'jonespassword' }, :token => post_redirect } }.should_not raise_error(NoMethodError) + post :signin, { :user_signin => { :email => 'bob@localhost', :password => 'jonespassword' }, + :token => post_redirect } response.should render_template('sign') + assigns[:post_redirect].should == nil end # No idea how to test this in the test framework :( |