0
0
Fork 0

Fix missing value limits for UserRole position (#33172)

This commit is contained in:
Matt Jankowski 2024-12-18 03:29:27 -05:00 committed by GitHub
parent 1992c2a4fa
commit ca2a7d66b8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 13 additions and 0 deletions

View file

@ -18,6 +18,16 @@ RSpec.describe UserRole do
end
end
describe 'position' do
subject { Fabricate.build :user_role }
let(:excess) { 2**32 }
let(:limit) { 2**31 }
it { is_expected.to_not allow_values(-excess, excess).for(:position) }
it { is_expected.to allow_values(-limit, limit).for(:position) }
end
describe 'color' do
it { is_expected.to allow_values('#112233', '#aabbcc', '').for(:color) }
it { is_expected.to_not allow_values('x', '112233445566', '#xxyyzz').for(:color) }