aboutsummaryrefslogtreecommitdiffstats
path: root/spec/controllers/user_controller_spec.rb
diff options
context:
space:
mode:
authorDavid Cabo <david@calibea.com>2012-01-06 18:54:37 +0100
committerDavid Cabo <david@calibea.com>2012-01-06 18:54:37 +0100
commitd4f3ca2a2f7cc68663a9ca005cf379533032d232 (patch)
treef6d2a07fd1e4f8e1091d5df765b68140db5e47ca /spec/controllers/user_controller_spec.rb
parent7ed887f0989425d9e412890800df05637b08c025 (diff)
parent766d696d5b914520b0b9367e9b9a9decab87ea5f (diff)
Merge branch 'release/0.5' of github.com:sebbacon/alaveteli into release/0.5
Diffstat (limited to 'spec/controllers/user_controller_spec.rb')
-rw-r--r--spec/controllers/user_controller_spec.rb10
1 files changed, 10 insertions, 0 deletions
diff --git a/spec/controllers/user_controller_spec.rb b/spec/controllers/user_controller_spec.rb
index 399b275a7..c13d7c9fc 100644
--- a/spec/controllers/user_controller_spec.rb
+++ b/spec/controllers/user_controller_spec.rb
@@ -28,6 +28,16 @@ describe UserController, "when showing a user" do
response.should render_template('show')
end
+ it "should distinguish between 'my profile' and 'my requests' for logged in users" do
+ session[:user_id] = users(:bob_smith_user).id
+ get :show, :url_name => "bob_smith", :view => 'requests'
+ response.body.should_not include("Change your password")
+ response.body.should match(/Your [0-9]+ Freedom of Information requests/)
+ get :show, :url_name => "bob_smith", :view => 'profile'
+ response.body.should include("Change your password")
+ response.body.should_not match(/Your [0-9]+ Freedom of Information requests/)
+ end
+
it "should assign the user" do
get :show, :url_name => "bob_smith"
assigns[:display_user].should == users(:bob_smith_user)