spec/groupdocs/datasource/field_spec.rb in groupdocs-0.3.7 vs spec/groupdocs/datasource/field_spec.rb in groupdocs-0.3.8

- old
+ new

@@ -2,49 +2,31 @@ describe GroupDocs::DataSource::Field do it_behaves_like GroupDocs::Api::Entity - describe 'TYPES' do - it 'contains hash of field types' do - described_class::TYPES.should == { - text: 0, - binary: 1, - } - end - end - - it { should respond_to(:field) } - it { should respond_to(:field=) } + it { should respond_to(:name) } + it { should respond_to(:name=) } it { should respond_to(:type) } it { should respond_to(:type=) } it { should respond_to(:values) } it { should respond_to(:values=) } - it 'is compatible with response JSON' do - subject.should respond_to(:name=) - subject.method(:name=).should == subject.method(:field=) - end - describe '#type=' do it 'saves type in machine readable format if symbol is passed' do subject.type = :binary - subject.instance_variable_get(:@type).should == 1 + subject.instance_variable_get(:@type).should == 'Binary' end it 'does nothing if parameter is not symbol' do - subject.type = 1 - subject.instance_variable_get(:@type).should == 1 + subject.type = 'Binary' + subject.instance_variable_get(:@type).should == 'Binary' end - - it 'raises error if type is unknown' do - -> { subject.type = :unknown }.should raise_error(ArgumentError) - end end describe '#type' do it 'returns type in human-readable format' do - subject.type = 1 + subject.type = 'Binary' subject.type.should == :binary end end end