mirror of
https://github.com/discourse/discourse.git
synced 2025-03-23 01:23:09 +08:00
FIX: Move selectable_avatars_mode_validator_spec to new directory (#16048)
Lib specs moved in 45cc16098dee51fc2bee0e5873afa51fe2bd1ea3 Move the new selectable_avatars_mode_validator_spec to the new location Remove the old selectable_avatars_enabled_validator_spec follow-up of d1bdb6c65d1d1de8f610d1e39bf3788c0c241ef6
This commit is contained in:
parent
d1bdb6c65d
commit
85f1ec643d
@ -1,30 +0,0 @@
|
||||
# frozen_string_literal: true
|
||||
|
||||
require 'rails_helper'
|
||||
|
||||
describe SelectableAvatarsEnabledValidator do
|
||||
describe '#valid_value?' do
|
||||
subject(:validator) { described_class.new }
|
||||
|
||||
it "returns true when disabling" do
|
||||
SiteSetting.selectable_avatars = ""
|
||||
expect(validator.valid_value?("f")).to eq(true)
|
||||
|
||||
SiteSetting.selectable_avatars = [Fabricate(:image_upload), Fabricate(:image_upload)]
|
||||
expect(validator.valid_value?("f")).to eq(true)
|
||||
end
|
||||
|
||||
it "returns true when there are at least two selectable avatars" do
|
||||
SiteSetting.selectable_avatars = [Fabricate(:image_upload), Fabricate(:image_upload)]
|
||||
expect(validator.valid_value?("t")).to eq(true)
|
||||
end
|
||||
|
||||
it "returns false when selectable avatars is blank or has one avatar" do
|
||||
SiteSetting.selectable_avatars = ""
|
||||
expect(validator.valid_value?("t")).to eq(false)
|
||||
|
||||
SiteSetting.selectable_avatars = [Fabricate(:image_upload)]
|
||||
expect(validator.valid_value?("t")).to eq(false)
|
||||
end
|
||||
end
|
||||
end
|
Loading…
x
Reference in New Issue
Block a user