Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'spec/models/users/banned_user_spec.rb')
-rw-r--r--spec/models/users/banned_user_spec.rb21
1 files changed, 21 insertions, 0 deletions
diff --git a/spec/models/users/banned_user_spec.rb b/spec/models/users/banned_user_spec.rb
new file mode 100644
index 00000000000..b55c4821d05
--- /dev/null
+++ b/spec/models/users/banned_user_spec.rb
@@ -0,0 +1,21 @@
+# frozen_string_literal: true
+
+require 'spec_helper'
+
+RSpec.describe Users::BannedUser do
+ describe 'relationships' do
+ it { is_expected.to belong_to(:user) }
+ end
+
+ describe 'validations' do
+ before do
+ create(:user, :banned)
+ end
+
+ it { is_expected.to validate_presence_of(:user) }
+
+ it 'validates uniqueness of banned user id' do
+ is_expected.to validate_uniqueness_of(:user_id).with_message("banned user already exists")
+ end
+ end
+end