diff options
author | Francis Irving <francis@mysociety.org> | 2010-07-15 16:18:32 +0100 |
---|---|---|
committer | Francis Irving <francis@mysociety.org> | 2010-07-15 16:18:32 +0100 |
commit | c5067bb626fea89a0e2f9982d417a39c854d3305 (patch) | |
tree | 463a11cc5ffea5a6944f29098c41453cc35f6269 | |
parent | e9a1132bb4d860fa92a6a1eb13dd291f5acdb978 (diff) |
Fix HTML
-rw-r--r-- | app/views/user/set_draft_profile_photo.rhtml | 9 | ||||
-rw-r--r-- | spec/controllers/user_controller_spec.rb | 10 |
2 files changed, 12 insertions, 7 deletions
diff --git a/app/views/user/set_draft_profile_photo.rhtml b/app/views/user/set_draft_profile_photo.rhtml index 03ebb05d3..16a729948 100644 --- a/app/views/user/set_draft_profile_photo.rhtml +++ b/app/views/user/set_draft_profile_photo.rhtml @@ -23,11 +23,14 @@ <script type="text/javascript" charset="utf-8"> document.write('<%= submit_tag "Next, crop your photo >>" %>'); </script> - <noscript> + </p> + + <noscript> + <div> <%= hidden_field_tag 'automatically_crop', 1 %> <%= submit_tag "Done >>" %> - </noscript> - </p> + </div> + </noscript> <% end %> diff --git a/spec/controllers/user_controller_spec.rb b/spec/controllers/user_controller_spec.rb index c102f0f90..5c2893aaa 100644 --- a/spec/controllers/user_controller_spec.rb +++ b/spec/controllers/user_controller_spec.rb @@ -468,14 +468,14 @@ describe UserController, "when using profile photos" do end it "should not let you change profile photo if you're not logged in as the user" do - post :set_profile_photo, { :id => @user.id, :file => @uploadedfile, :submitted_profile_photo => 1 } + post :set_profile_photo, { :id => @user.id, :file => @uploadedfile, :submitted_profile_photo => 1, :automatically_crop => 1 } end it "should let you change profile photo if you're logged in as the user" do @user.profile_photo.should be_nil session[:user_id] = @user.id - post :set_profile_photo, { :id => @user.id, :file => @uploadedfile, :submitted_profile_photo => 1 } + post :set_profile_photo, { :id => @user.id, :file => @uploadedfile, :submitted_profile_photo => 1, :automatically_crop => 1 } response.should redirect_to(:controller => 'user', :action => 'show', :url_name => "bob_smith") flash[:notice].should match(/Thank you for updating your profile photo/) @@ -488,16 +488,18 @@ describe UserController, "when using profile photos" do @user.profile_photo.should be_nil session[:user_id] = @user.id - post :set_profile_photo, { :id => @user.id, :file => @uploadedfile, :submitted_profile_photo => 1 } + post :set_profile_photo, { :id => @user.id, :file => @uploadedfile, :submitted_draft_profile_photo => 1, :automatically_crop => 1 } response.should redirect_to(:controller => 'user', :action => 'show', :url_name => "bob_smith") flash[:notice].should match(/Thank you for updating your profile photo/) - post :set_profile_photo, { :id => @user.id, :file => @uploadedfile_2, :submitted_profile_photo => 1 } + post :set_profile_photo, { :id => @user.id, :file => @uploadedfile_2, :submitted_draft_profile_photo => 1, :automatically_crop => 1 } response.should redirect_to(:controller => 'user', :action => 'show', :url_name => "bob_smith") flash[:notice].should match(/Thank you for updating your profile photo/) @user.reload @user.profile_photo.should_not be_nil end + + # XXX todo check the two stage javascript cropping (above only tests one stage non-javascript one) end |