diff options
author | Rémy Coutable <remy@rymai.me> | 2018-05-02 08:10:34 +0000 |
---|---|---|
committer | Rémy Coutable <remy@rymai.me> | 2018-05-02 08:10:34 +0000 |
commit | bdb238a0651e0c517e461afbb9d28f1653a97596 (patch) | |
tree | ccaa33dda8d3ee6dc0a3efc7b6bffcad777aabcf | |
parent | 2fe82443bf91e1f4e872fb304719a3f393052197 (diff) | |
parent | 0319da686d6422bda351c945ea6519d672afb60c (diff) | |
download | gitlab-ce-bdb238a0651e0c517e461afbb9d28f1653a97596.tar.gz |
Merge branch 'blackst0ne-rails5-fix-notification-setting-spec' into 'master'
[Rails5] Fix spec/models/notification_setting_spec.rb
See merge request gitlab-org/gitlab-ce!18664
-rw-r--r-- | spec/models/notification_setting_spec.rb | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/spec/models/notification_setting_spec.rb b/spec/models/notification_setting_spec.rb index 2a0d102d3fe..12681a147b4 100644 --- a/spec/models/notification_setting_spec.rb +++ b/spec/models/notification_setting_spec.rb @@ -40,7 +40,12 @@ RSpec.describe NotificationSetting do expect(notification_setting.new_issue).to eq(true) expect(notification_setting.close_issue).to eq(true) expect(notification_setting.merge_merge_request).to eq(true) - expect(notification_setting.close_merge_request).to eq(false) + + # In Rails 5 assigning a value which is not explicitly `true` or `false` ("nil" in this case) + # to a boolean column transforms it to `true`. + # In Rails 4 it transforms the value to `false` with deprecation warning. + # Replace `eq(Gitlab.rails5?)` with `eq(true)` when removing rails5? code. + expect(notification_setting.close_merge_request).to eq(Gitlab.rails5?) expect(notification_setting.reopen_merge_request).to eq(false) end end |