aboutsummaryrefslogtreecommitdiffstats
path: root/spec
diff options
context:
space:
mode:
Diffstat (limited to 'spec')
-rw-r--r--spec/controllers/user_controller_spec.rb9
-rw-r--r--spec/fixtures/users.yml5
2 files changed, 14 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
diff --git a/spec/fixtures/users.yml b/spec/fixtures/users.yml
index 8620fb3de..d6391c5e8 100644
--- a/spec/fixtures/users.yml
+++ b/spec/fixtures/users.yml
@@ -12,6 +12,7 @@ bob_smith_user:
ban_text: ''
locale: 'en'
about_me: 'I like making requests about fancy dogs and naughty chickens and stuff.'
+ receive_email_alerts: true
silly_name_user:
id: "2"
name: "Silly <em>Name</em>"
@@ -26,6 +27,7 @@ silly_name_user:
ban_text: ''
locale: 'en'
about_me: ''
+ receive_email_alerts: true
admin_user:
id: "3"
name: Joe Admin
@@ -40,6 +42,7 @@ admin_user:
ban_text: ''
locale: ''
about_me: ''
+ receive_email_alerts: true
unconfirmed_user:
id: "4"
name: "Unconfirmed"
@@ -53,6 +56,7 @@ unconfirmed_user:
admin_level: 'none'
ban_text: ''
about_me: ''
+ receive_email_alerts: true
robin_user:
id: 5
name: Robin Houston
@@ -66,3 +70,4 @@ robin_user:
admin_level: 'none'
ban_text: ''
about_me: 'I am the best'
+ receive_email_alerts: true