mirror of
https://github.com/openSUSE/osem.git
synced 2026-08-13 19:54:02 +00:00
Adopt more specs to the shoulda-matchers update
This commit is contained in:
parent
b778459e17
commit
bec13df131
3 changed files with 3 additions and 3 deletions
|
|
@ -18,7 +18,7 @@ class Cfp < ApplicationRecord
|
||||||
in: TYPES
|
in: TYPES
|
||||||
},
|
},
|
||||||
uniqueness: {
|
uniqueness: {
|
||||||
scope: :program,
|
scope: :program_id,
|
||||||
case_sensitive: false
|
case_sensitive: false
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,7 @@ describe Cfp do
|
||||||
describe 'validations' do
|
describe 'validations' do
|
||||||
it { is_expected.to validate_presence_of(:cfp_type) }
|
it { is_expected.to validate_presence_of(:cfp_type) }
|
||||||
it { is_expected.to validate_inclusion_of(:cfp_type).in_array(Cfp::TYPES) }
|
it { is_expected.to validate_inclusion_of(:cfp_type).in_array(Cfp::TYPES) }
|
||||||
it { is_expected.to validate_uniqueness_of(:cfp_type).scoped_to(:program_id).case_insensitive }
|
it { is_expected.to validate_uniqueness_of(:cfp_type).ignoring_case_sensitivity.scoped_to(:program_id) }
|
||||||
end
|
end
|
||||||
|
|
||||||
describe '.for_events' do
|
describe '.for_events' do
|
||||||
|
|
|
||||||
|
|
@ -27,7 +27,7 @@ describe User do
|
||||||
|
|
||||||
it { is_expected.to validate_presence_of(:email) }
|
it { is_expected.to validate_presence_of(:email) }
|
||||||
it { is_expected.to validate_presence_of(:username) }
|
it { is_expected.to validate_presence_of(:username) }
|
||||||
it { is_expected.to validate_uniqueness_of(:username) }
|
it { is_expected.to validate_uniqueness_of(:username).ignoring_case_sensitivity }
|
||||||
|
|
||||||
it 'biography can not have more than 150 words' do
|
it 'biography can not have more than 150 words' do
|
||||||
# Text with 151 words
|
# Text with 151 words
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue