FIX: Move selectable_avatars_mode_validator_spec to new directory (#16048)

Lib specs moved in 45cc16098d
Move the new selectable_avatars_mode_validator_spec to the new location
Remove the old selectable_avatars_enabled_validator_spec

follow-up of d1bdb6c65d
This commit is contained in:
Jeff Wong 2022-02-24 11:57:26 -10:00 committed by GitHub
parent d1bdb6c65d
commit 85f1ec643d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 0 additions and 30 deletions

View File

@ -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