Sha256: b2fb188578bf387a1f24bb54c41275cff559298f5ce68ce157b36bc214ce7e3d

Contents?: true

Size: 1.2 KB

Versions: 23

Compression:

Stored size: 1.2 KB

Contents

require 'spec_helper'

describe StorageRoom::Image do
  before(:each) do
    @image = StorageRoom::Image.new
    @image.response_data = {
      '@type' => 'Image',
      '@url' => 'URL',
      '@processing' => false,
      '@versions' => {
        'thumbnail' => {
          '@url' => 'THUMBNAIL_URL'
        }
      }
    }
  end
  
  context "Methods" do
    describe "#image_versions" do
      it "should return array" do
        @image.version_identifiers.should == ['thumbnail']
      end
    end
    
    describe "#url" do
      it "should return URL for the image" do
        @image.url.should == 'URL'
      end
      
      it "should return URL for a version" do
        @image.url(:thumbnail).should == 'THUMBNAIL_URL'
      end
      
      it "should raise error on invalid version" do
        lambda {
          @image.url(:asdf)
        }.should raise_error
      end
    end
    
    describe "#processing?" do
      it "should return true" do
        @image.response_data['@processing'] = true
        @image.should be_processing
      end
      
      it "should return false" do
        @image.response_data['@processing'] = false
        @image.should_not be_processing
      end
    end
    
  end
end

Version data entries

23 entries across 23 versions & 1 rubygems

Version Path
storage_room-0.3.24 spec/storage_room/embeddeds/image_spec.rb
storage_room-0.3.23 spec/storage_room/embeddeds/image_spec.rb
storage_room-0.3.22 spec/storage_room/embeddeds/image_spec.rb
storage_room-0.3.21 spec/storage_room/embeddeds/image_spec.rb
storage_room-0.3.20 spec/storage_room/embeddeds/image_spec.rb
storage_room-0.3.19 spec/storage_room/embeddeds/image_spec.rb
storage_room-0.3.18 spec/storage_room/embeddeds/image_spec.rb
storage_room-0.3.17 spec/storage_room/embeddeds/image_spec.rb
storage_room-0.3.16 spec/storage_room/embeddeds/image_spec.rb
storage_room-0.3.15 spec/storage_room/embeddeds/image_spec.rb
storage_room-0.3.14 spec/storage_room/embeddeds/image_spec.rb
storage_room-0.3.13 spec/storage_room/embeddeds/image_spec.rb
storage_room-0.3.12 spec/storage_room/embeddeds/image_spec.rb
storage_room-0.3.11 spec/storage_room/embeddeds/image_spec.rb
storage_room-0.3.10 spec/storage_room/embeddeds/image_spec.rb
storage_room-0.3.9 spec/storage_room/embeddeds/image_spec.rb
storage_room-0.3.8 spec/storage_room/embeddeds/image_spec.rb
storage_room-0.3.7 spec/storage_room/embeddeds/image_spec.rb
storage_room-0.3.6 spec/storage_room/embeddeds/image_spec.rb
storage_room-0.3.5 spec/storage_room/embeddeds/image_spec.rb