UX: make name optional for confirmation user field (#7149)

This commit is contained in:
Maja Komel
2019-03-13 18:40:43 +01:00
committed by Régis Hanol
parent 12c37ada2e
commit 65f3ed0689
3 changed files with 27 additions and 4 deletions

View File

@ -0,0 +1,13 @@
require 'rails_helper'
describe UserField do
describe "doesn't validate presence of name if field type is 'confirm'" do
subject { described_class.new(field_type: 'confirm') }
it { is_expected.not_to validate_presence_of :name }
end
describe "validates presence of name for other field types" do
subject { described_class.new(field_type: 'dropdown') }
it { is_expected.to validate_presence_of :name }
end
end