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,31 +6,27 @@ class EnvironmentNotificationTest < ActiveSupport::TestCase | ||
| 6 | @env = Environment.default | 6 | @env = Environment.default |
| 7 | @env.enable_plugin('EnvironmentNotificationPlugin') | 7 | @env.enable_plugin('EnvironmentNotificationPlugin') |
| 8 | 8 | ||
| 9 | - User.destroy_all | ||
| 10 | - EnvironmentNotificationPlugin::EnvironmentNotification.destroy_all | ||
| 11 | - EnvironmentNotificationsUser.destroy_all | ||
| 12 | - | ||
| 13 | @user = User.create!(:environment_id => @env.id, :email => "user@domain.com", :login => "new_user", :password => "test", :password_confirmation => "test") | 9 | @user = User.create!(:environment_id => @env.id, :email => "user@domain.com", :login => "new_user", :password => "test", :password_confirmation => "test") |
| 14 | @danger_notification = EnvironmentNotificationPlugin::DangerNotification.create!( | 10 | @danger_notification = EnvironmentNotificationPlugin::DangerNotification.create!( |
| 15 | - :environment_id => @env.id, | 11 | + :target_id => @env.id, |
| 16 | :message => "Danger Message", | 12 | :message => "Danger Message", |
| 17 | :active => true, | 13 | :active => true, |
| 18 | ) | 14 | ) |
| 19 | 15 | ||
| 20 | @warning_notification = EnvironmentNotificationPlugin::WarningNotification.create!( | 16 | @warning_notification = EnvironmentNotificationPlugin::WarningNotification.create!( |
| 21 | - :environment_id => @env.id, | 17 | + :target_id => @env.id, |
| 22 | :message => "Warning Message", | 18 | :message => "Warning Message", |
| 23 | :active => true, | 19 | :active => true, |
| 24 | ) | 20 | ) |
| 25 | 21 | ||
| 26 | @information_notification = EnvironmentNotificationPlugin::InformationNotification.create!( | 22 | @information_notification = EnvironmentNotificationPlugin::InformationNotification.create!( |
| 27 | - :environment_id => @env.id, | 23 | + :target_id => @env.id, |
| 28 | :message => "Information Message", | 24 | :message => "Information Message", |
| 29 | :active => true, | 25 | :active => true, |
| 30 | ) | 26 | ) |
| 31 | end | 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 | @information_notification.users << @user | 30 | @information_notification.users << @user |
| 35 | 31 | ||
| 36 | notifications = EnvironmentNotificationPlugin::EnvironmentNotification.visibles(@env, @user, nil) | 32 | notifications = EnvironmentNotificationPlugin::EnvironmentNotification.visibles(@env, @user, nil) |