Adjust tests to work with latest shoulda gem

Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
This commit is contained in:
Dmitriy Zaporozhets 2017-07-24 19:26:15 +03:00
parent cc577b8970
commit 3a0b9e06e1
No known key found for this signature in database
GPG key ID: 627C5F589F467F17
3 changed files with 6 additions and 8 deletions

View file

@ -13,12 +13,6 @@ describe List do
it { is_expected.to validate_presence_of(:position) }
it { is_expected.to validate_numericality_of(:position).only_integer.is_greater_than_or_equal_to(0) }
it 'validates uniqueness of label scoped to board_id' do
create(:list)
expect(subject).to validate_uniqueness_of(:label_id).scoped_to(:board_id)
end
context 'when list_type is set to closed' do
subject { described_class.new(list_type: :closed) }

View file

@ -13,7 +13,9 @@ RSpec.describe NotificationSetting, type: :model do
it { is_expected.to validate_presence_of(:level) }
describe 'user_id' do
before { subject.user = create(:user) }
before do
subject.user = create(:user)
end
it { is_expected.to validate_uniqueness_of(:user_id).scoped_to([:source_type, :source_id]).with_message(/already exists in source/) }
end

View file

@ -114,7 +114,9 @@ describe User, models: true do
end
it 'validates uniqueness' do
expect(subject).to validate_uniqueness_of(:username).case_insensitive
user = build(:user)
expect(user).to validate_uniqueness_of(:username).case_insensitive
end
end