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-30 13:50:39 +0100
commit6fafad02cfa746a04281ffe4951d0d89ba322f6d (patch)
tree5be39c9f4f35066fbcd70a8cddf8ab036e3d3c42 /spec/controllers/user_controller_spec.rb
parente2820105a698d8af93c213f5df31578acda545fe (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