Sha256: fc28fa76d49618215540d3c4c82cd9e4a56e42f5c919f26021b1d89044598a65
Contents?: true
Size: 993 Bytes
Versions: 22
Compression:
Stored size: 993 Bytes
Contents
require 'spec_helper' describe GroupDocs::Document::View do it_behaves_like GroupDocs::Api::Entity it { should have_accessor(:document) } it { should have_accessor(:short_url) } it { should have_accessor(:viewed_on) } describe '#document=' do it 'sets document if GroupDocs::Document object is passed' do document = GroupDocs::Document.new(:file => GroupDocs::Storage::File.new) subject.document = document subject.document.should == document end it 'creates new GroupDocs::Document object from passed hash' do subject.document = { :id => 1, :name => 'test.pdf' } document = subject.document document.should be_a(GroupDocs::Document) document.file.id.should == 1 document.file.name.should == 'test.pdf' end end describe '#viewed_on' do it 'returns converted to Time object Unix timestamp' do subject.viewed_on = 1330450135000 subject.viewed_on.should == Time.at(1330450135) end end end
Version data entries
22 entries across 22 versions & 1 rubygems