Skip to content
Snippets Groups Projects
Verified Commit cc577b89 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets
Browse files

Update tests for new version of shoulda-matchers

parent eafb03cf
No related branches found
No related tags found
No related merge requests found
Loading
Loading
@@ -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) }
Loading
Loading
Loading
Loading
@@ -11,7 +11,7 @@ describe PagesDomain, models: true do
context 'is unique' do
let(:domain) { 'my.domain.com' }
 
it { is_expected.to validate_uniqueness_of(:domain) }
it { is_expected.to validate_uniqueness_of(:domain).case_insensitive }
end
 
{
Loading
Loading
Loading
Loading
@@ -11,7 +11,7 @@ describe RedirectRoute, models: true do
describe 'validations' do
it { is_expected.to validate_presence_of(:source) }
it { is_expected.to validate_presence_of(:path) }
it { is_expected.to validate_uniqueness_of(:path) }
it { is_expected.to validate_uniqueness_of(:path).case_insensitive }
end
 
describe '.matching_path_and_descendants' do
Loading
Loading
Loading
Loading
@@ -15,7 +15,7 @@ describe Route, models: true do
 
it { is_expected.to validate_presence_of(:source) }
it { is_expected.to validate_presence_of(:path) }
it { is_expected.to validate_uniqueness_of(:path) }
it { is_expected.to validate_uniqueness_of(:path).case_insensitive }
end
 
describe 'callbacks' do
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment