diff options
author | Francis Irving <francis@mysociety.org> | 2010-07-14 00:20:32 +0100 |
---|---|---|
committer | Francis Irving <francis@mysociety.org> | 2010-07-14 00:20:32 +0100 |
commit | 55a4eb4e26992eb77c4d89f41846607a59357c73 (patch) | |
tree | 5699a655f3165e00a44c8a6d5cccbccf3c2d1a76 /spec/controllers/user_controller_spec.rb | |
parent | e01671af006343de0ace34dcb860903ef8451141 (diff) |
Test for submitting profile photo. Clean up HTML.
Diffstat (limited to 'spec/controllers/user_controller_spec.rb')
-rw-r--r-- | spec/controllers/user_controller_spec.rb | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/spec/controllers/user_controller_spec.rb b/spec/controllers/user_controller_spec.rb index 5d436fc9c..cdd911ec7 100644 --- a/spec/controllers/user_controller_spec.rb +++ b/spec/controllers/user_controller_spec.rb @@ -462,5 +462,17 @@ describe UserController, "when using profile photos" do data = load_file_fixture("parrot.png") post :profile_photo, { :id => user.id, :data => data } end + + it "should let you change profile photo if you're logged in as the user" do + user = users(:bob_smith_user) + user.profile_photo.should be_nil + + session[:user_id] = user.id + data = load_file_fixture("parrot.png") + post :profile_photo, { :id => user.id, :data => data } + + response.should redirect_to(:controller => 'user', :action => 'show', :url_name => "bob_smith") + user.profile_photo.should_not be_nil + end end |