summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorSean McGivern <sean@gitlab.com>2017-06-06 17:37:15 +0100
committerSean McGivern <sean@gitlab.com>2017-06-15 15:14:45 +0100
commitf4b5fcbca100769b89e6b06e0df180012d16a7a8 (patch)
tree7b1cb582647cbbbdabf5521e1c1055e3f89f53e4 /spec
parent051b8dc4e3d055f7ac848a80d26bf1e6e0af2e24 (diff)
downloadgitlab-ce-f4b5fcbca100769b89e6b06e0df180012d16a7a8.tar.gz
Add columns for custom notification settings
Add columns for each custom notification level, defaulting to null. Read from those columns if non-null, otherwise fall back to the serialized column. Writing will write to the new column if `events` isn't manually set.
Diffstat (limited to 'spec')
-rw-r--r--spec/controllers/notification_settings_controller_spec.rb10
1 files changed, 8 insertions, 2 deletions
diff --git a/spec/controllers/notification_settings_controller_spec.rb b/spec/controllers/notification_settings_controller_spec.rb
index cf136e72bac..c2d0970ef88 100644
--- a/spec/controllers/notification_settings_controller_spec.rb
+++ b/spec/controllers/notification_settings_controller_spec.rb
@@ -58,7 +58,10 @@ describe NotificationSettingsController do
expect(response.status).to eq 200
expect(notification_setting.level).to eq("custom")
- expect(notification_setting.events).to eq(custom_events)
+
+ custom_events.each do |event, value|
+ expect(notification_setting.send(event)).to eq(value)
+ end
end
end
end
@@ -86,7 +89,10 @@ describe NotificationSettingsController do
expect(response.status).to eq 200
expect(notification_setting.level).to eq("custom")
- expect(notification_setting.events).to eq(custom_events)
+
+ custom_events.each do |event, value|
+ expect(notification_setting.send(event)).to eq(value)
+ end
end
end
end