spec/groupdocs/signature/field_spec.rb in groupdocs-1.3.0 vs spec/groupdocs/signature/field_spec.rb in groupdocs-1.4.0

- old
+ new

@@ -70,11 +70,10 @@ it { should alias_accessor(:font_size, :fontSize) } it { should alias_accessor(:font_bold, :fontBold) } it { should alias_accessor(:font_italic, :fontItalic) } it { should alias_accessor(:font_underline, :fontUnderline) } it { should alias_accessor(:is_system, :isSystem) } - it { should alias_accessor(:acceptable_values, :acceptableValues) } it { should alias_accessor(:default_value, :defaultValue) } it { should alias_accessor(:text_rows, :textRows) } it { should alias_accessor(:text_columns, :textColumns) } describe '#location=' do @@ -158,9 +157,28 @@ subject.field_type.should == :multiline end it 'is aliased to #type' do subject.should have_alias(:type, :field_type) + end + end + + describe '#acceptable_values=' do + it 'converts values in machine-readable format if array is passed' do + subject.acceptable_values = %w(on off) + subject.instance_variable_get(:@acceptableValues).should == 'on;off' + end + + it 'saves values as is if not an array is passed' do + subject.acceptable_values = 'on;off' + subject.instance_variable_get(:@acceptableValues).should == 'on;off' + end + end + + describe '#acceptable_values' do + it 'returns values in human-readable format' do + subject.acceptable_values = %w(on off) + subject.acceptable_values.should == %w(on off) end end describe '#create!' do before(:each) do