BigW Consortium Gitlab

Adjust tests to work with latest shoulda gem

parent cc577b89
......@@ -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) }
......
......@@ -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
......
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment