summaryrefslogtreecommitdiff
path: root/spec/models/notification_setting_spec.rb
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2017-07-24 15:33:14 +0300
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2017-07-24 15:33:14 +0300
commitcc577b89706686063d4ff0d86a11c63b6570231c (patch)
treee1b5b068b8ef28c7ae270e4f3507e11a4fb441e6 /spec/models/notification_setting_spec.rb
parenteafb03cfd5904893c3f05cd6a596997ccee09963 (diff)
downloadgitlab-ce-cc577b89706686063d4ff0d86a11c63b6570231c.tar.gz
Update tests for new version of shoulda-matchers
Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Diffstat (limited to 'spec/models/notification_setting_spec.rb')
-rw-r--r--spec/models/notification_setting_spec.rb7
1 files changed, 6 insertions, 1 deletions
diff --git a/spec/models/notification_setting_spec.rb b/spec/models/notification_setting_spec.rb
index cc235ad467e..74fa1c1f926 100644
--- a/spec/models/notification_setting_spec.rb
+++ b/spec/models/notification_setting_spec.rb
@@ -11,7 +11,12 @@ RSpec.describe NotificationSetting, type: :model do
it { is_expected.to validate_presence_of(:user) }
it { is_expected.to validate_presence_of(:level) }
- it { is_expected.to validate_uniqueness_of(:user_id).scoped_to([:source_id, :source_type]).with_message(/already exists in source/) }
+
+ describe 'user_id' do
+ before { subject.user = create(:user) }
+
+ it { is_expected.to validate_uniqueness_of(:user_id).scoped_to([:source_type, :source_id]).with_message(/already exists in source/) }
+ end
context "events" do
let(:user) { create(:user) }