Sha256: 745e736251f93e0f711a1c5063b6d263a7f72edad70eb883c8ec2c4ab30d73da

Contents?: true

Size: 899 Bytes

Versions: 30

Compression:

Stored size: 899 Bytes

Contents

require 'spec_helper'

describe Contentful::File do
  let(:file) { vcr('asset') { create_client.asset('nyancat').file } }

  describe 'Properties' do
    it 'has #file_name' do
      expect(file.file_name).to eq 'Nyan_cat_250px_frame.png'
    end

    it 'has #content_type' do
      expect(file.content_type).to eq 'image/png'
    end

    it 'has #url' do
      expect(file.url).to eq '//images.contentful.com/cfexampleapi/4gp6taAwW4CmSgumq2ekUm/9da0cd1936871b8d72343e895a00d611/Nyan_cat_250px_frame.png'
    end

    it 'has #details' do
      expect(file.details).to be_instance_of Hash
    end
  end

  describe 'camel case' do
    it 'supports camel case' do
      vcr('asset') {
        file = create_client(use_camel_case: true).asset('nyancat').file
        expect(file.contentType).to eq 'image/png'
        expect(file.fileName).to eq 'Nyan_cat_250px_frame.png'
      }
    end
  end
end

Version data entries

30 entries across 30 versions & 1 rubygems

Version Path
contentful-2.16.0 spec/file_spec.rb
contentful-2.15.4 spec/file_spec.rb
contentful-2.15.3 spec/file_spec.rb
contentful-2.15.2 spec/file_spec.rb
contentful-2.15.1 spec/file_spec.rb
contentful-2.15.0 spec/file_spec.rb
contentful-2.14.0 spec/file_spec.rb
contentful-2.13.3 spec/file_spec.rb
contentful-2.13.2 spec/file_spec.rb
contentful-2.13.1 spec/file_spec.rb
contentful-2.13.0 spec/file_spec.rb
contentful-2.12.0 spec/file_spec.rb
contentful-2.11.1 spec/file_spec.rb
contentful-2.11.0 spec/file_spec.rb
contentful-2.10.1 spec/file_spec.rb
contentful-2.10.0 spec/file_spec.rb
contentful-2.9.4 spec/file_spec.rb
contentful-2.9.3 spec/file_spec.rb
contentful-2.9.2 spec/file_spec.rb
contentful-2.9.1 spec/file_spec.rb