spec/groupdocs/storage/folder_spec.rb in groupdocs-1.1.0 vs spec/groupdocs/storage/folder_spec.rb in groupdocs-1.2.0
- old
+ new
@@ -47,30 +47,20 @@
folder.should_receive(:list!).with({}, {})
described_class.list!
end
end
- it { should respond_to(:id) }
- it { should respond_to(:id=) }
- it { should respond_to(:size) }
- it { should respond_to(:size=) }
- it { should respond_to(:folder_count) }
- it { should respond_to(:folder_count=) }
- it { should respond_to(:file_count) }
- it { should respond_to(:file_count=) }
- it { should respond_to(:created_on) }
- it { should respond_to(:created_on=) }
- it { should respond_to(:modified_on) }
- it { should respond_to(:modified_on=) }
- it { should respond_to(:url) }
- it { should respond_to(:url=) }
- it { should respond_to(:name) }
- it { should respond_to(:name=) }
- it { should respond_to(:version) }
- it { should respond_to(:version=) }
- it { should respond_to(:type) }
- it { should respond_to(:type=) }
+ it { should have_accessor(:id) }
+ it { should have_accessor(:size) }
+ it { should have_accessor(:folder_count) }
+ it { should have_accessor(:file_count) }
+ it { should have_accessor(:created_on) }
+ it { should have_accessor(:modified_on) }
+ it { should have_accessor(:url) }
+ it { should have_accessor(:name) }
+ it { should have_accessor(:version) }
+ it { should have_accessor(:type) }
describe '#created_on' do
it 'returns converted to Time object Unix timestamp' do
subject.created_on = 1330450135000
subject.created_on.should == Time.at(1330450135)
@@ -100,11 +90,15 @@
-> { subject.list!(page: 1, count: 1) }.should_not raise_error(ArgumentError)
end
it 'capitalizes :order_by option' do
options = { order_by: 'field' }
- options[:order_by].should_receive(:capitalize!)
- subject.list!(options)
+ -> { subject.list!(options) }.should change { options[:order_by] }.to('Field')
+ end
+
+ it 'camelizes :order_by option' do
+ options = { order_by: 'modified_on' }
+ -> { subject.list!(options) }.should change { options[:order_by] }.to('ModifiedOn')
end
it 'returns array' do
subject.list!.should be_an(Array)
end