Commit aa28efd096c49312bf891b42c42d8baf50bf2f65
1 parent
19c2ceb6
Exists in
community_notifications
fixes unit tests
Showing
1 changed file
with
4 additions
and
8 deletions
Show diff stats
plugins/environment_notification/test/unit/environment_notification_test.rb
... | ... | @@ -6,31 +6,27 @@ class EnvironmentNotificationTest < ActiveSupport::TestCase |
6 | 6 | @env = Environment.default |
7 | 7 | @env.enable_plugin('EnvironmentNotificationPlugin') |
8 | 8 | |
9 | - User.destroy_all | |
10 | - EnvironmentNotificationPlugin::EnvironmentNotification.destroy_all | |
11 | - EnvironmentNotificationsUser.destroy_all | |
12 | - | |
13 | 9 | @user = User.create!(:environment_id => @env.id, :email => "user@domain.com", :login => "new_user", :password => "test", :password_confirmation => "test") |
14 | 10 | @danger_notification = EnvironmentNotificationPlugin::DangerNotification.create!( |
15 | - :environment_id => @env.id, | |
11 | + :target_id => @env.id, | |
16 | 12 | :message => "Danger Message", |
17 | 13 | :active => true, |
18 | 14 | ) |
19 | 15 | |
20 | 16 | @warning_notification = EnvironmentNotificationPlugin::WarningNotification.create!( |
21 | - :environment_id => @env.id, | |
17 | + :target_id => @env.id, | |
22 | 18 | :message => "Warning Message", |
23 | 19 | :active => true, |
24 | 20 | ) |
25 | 21 | |
26 | 22 | @information_notification = EnvironmentNotificationPlugin::InformationNotification.create!( |
27 | - :environment_id => @env.id, | |
23 | + :target_id => @env.id, | |
28 | 24 | :message => "Information Message", |
29 | 25 | :active => true, |
30 | 26 | ) |
31 | 27 | end |
32 | 28 | |
33 | - should 'get all notifications that a user did not closed' do | |
29 | + should 'get all notifications that a user did not close' do | |
34 | 30 | @information_notification.users << @user |
35 | 31 | |
36 | 32 | notifications = EnvironmentNotificationPlugin::EnvironmentNotification.visibles(@env, @user, nil) | ... | ... |