summaryrefslogtreecommitdiff
path: root/spec/models
diff options
context:
space:
mode:
authorSean McGivern <sean@gitlab.com>2017-07-28 10:44:33 +0100
committerSean McGivern <sean@gitlab.com>2017-07-31 11:18:55 +0100
commit57a5544f883ad9687c38270519edc7914912af5d (patch)
treecf7713439a19e40d2c0b69fff197d3db0a74c8ed /spec/models
parent4c89929fb4211aa1cf5f311a0cec89988de45184 (diff)
downloadgitlab-ce-57a5544f883ad9687c38270519edc7914912af5d.tar.gz
Remove events column from notification settings33620-remove-events-from-notification_settings
This was migrated to separate columns in 9.4, and now just needs to be removed for real.
Diffstat (limited to 'spec/models')
-rw-r--r--spec/models/notification_setting_spec.rb12
1 files changed, 4 insertions, 8 deletions
diff --git a/spec/models/notification_setting_spec.rb b/spec/models/notification_setting_spec.rb
index 07e296424ca..2a0d102d3fe 100644
--- a/spec/models/notification_setting_spec.rb
+++ b/spec/models/notification_setting_spec.rb
@@ -63,24 +63,20 @@ RSpec.describe NotificationSetting do
end
end
- describe 'event_enabled?' do
+ describe '#event_enabled?' do
before do
subject.update!(user: create(:user))
end
context 'for an event with a matching column name' do
- before do
- subject.update!(events: { new_note: true }.to_json)
- end
-
it 'returns the value of the column' do
- subject.update!(new_note: false)
+ subject.update!(new_note: true)
- expect(subject.event_enabled?(:new_note)).to be(false)
+ expect(subject.event_enabled?(:new_note)).to be(true)
end
context 'when the column has a nil value' do
- it 'returns the value from the events hash' do
+ it 'returns false' do
expect(subject.event_enabled?(:new_note)).to be(false)
end
end