Revision 8192dbbb
Added by Stephen Benjamin over 9 years ago
test/functional/users_controller_test.rb | ||
---|---|---|
assert_redirected_to users_path
|
||
end
|
||
|
||
test "should assign a mail notification" do
|
||
user = FactoryGirl.create(:user, :with_mail)
|
||
notification = FactoryGirl.create(:mail_notification)
|
||
put :update, { :id => user.id, :user => { :mail_notification_ids => [notification.id] }}, set_session_user
|
||
user = User.find_by_id(user.id)
|
||
assert user.mail_notifications.include? notification
|
||
end
|
||
|
||
test "user changes should expire topbar cache" do
|
||
user = FactoryGirl.create(:user, :with_mail)
|
||
User.any_instance.expects(:expire_topbar_cache).once
|
Also available in: Unified diff
fixes #7586, #7734, #7172 - user preferences for receiving mail notifications
Adds a framework for user-selectable mail notifications. The work is
still done in ActionMailer classes and launch by rake in cron, however a
wrapper called MailNotification is used to provide RBAC and make the
association with users.
Plugins may seed their own mail notifications, see
db/seeds.d/16-mail-notifications.rb for an example.
Authors:
Shlomi Zadok <szadok@redhat.com>
Stephen Benjamin <stephen@redhat.com>
(cherry picked from commit 3a36bdf6179cfb3207af623584c021addb674ffb)