debian-mirror-gitlab/spec/models/users/banned_user_spec.rb

22 lines
471 B
Ruby
Raw Permalink Normal View History

2021-10-27 15:23:28 +05:30
# 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