aboutsummaryrefslogtreecommitdiffstats
path: root/spec/controllers/user_controller_spec.rb
diff options
context:
space:
mode:
authorSeb Bacon <seb.bacon@gmail.com>2012-05-16 12:04:23 +0100
committerSeb Bacon <seb.bacon@gmail.com>2012-05-16 12:04:23 +0100
commita8d085c1c366c0c0b934ccf3af801a6946155c64 (patch)
treee2541e11dbeb54b2a2c80722c7944a12369754b7 /spec/controllers/user_controller_spec.rb
parent267f1ca46e45ca75234be8db9b74cb072e0cbe06 (diff)
Test for user turning email alerts off. Also includes a fix not to rely on HTTP_REFERER for subsequent redirect.
Diffstat (limited to 'spec/controllers/user_controller_spec.rb')
-rw-r--r--spec/controllers/user_controller_spec.rb9
1 files changed, 9 insertions, 0 deletions
diff --git a/spec/controllers/user_controller_spec.rb b/spec/controllers/user_controller_spec.rb
index 37b8b33dc..7a6c9ac0d 100644
--- a/spec/controllers/user_controller_spec.rb
+++ b/spec/controllers/user_controller_spec.rb
@@ -658,4 +658,13 @@ describe UserController, "when viewing the wall" do
assigns[:feed_results][0].should_not == ire
end
+ it "should allow users to turn their own email alerts on and off" do
+ user = users(:silly_name_user)
+ session[:user_id] = user.id
+ user.receive_email_alerts.should == true
+ get :set_receive_email_alerts, :receive_email_alerts => 'false', :came_from => "/"
+ user.reload
+ user.receive_email_alerts.should_not == true
+ end
+
end