Sha256: cf609c276457dc35c9a862daed53df1d343a1fd60bee1ae9f9e7a06ab656ac81

Contents?: true

Size: 712 Bytes

Versions: 4

Compression:

Stored size: 712 Bytes

Contents

require 'spec_helper'

describe Reviewed::Product do
  describe 'attachments' do
    use_vcr_cassette 'product/attachments'

    before(:each) do
      @product = Reviewed::Product.find('minden-master-ii')
    end

    it 'returns all attachments' do
      @product.attachments.length.should == 1
    end

    it 'finds attachments by tag' do
      attachments = @product.attachments('vanity')
      attachments.length.should == 1
      attachments.each do |attachment|
        attachment.tags.join(',').should match(/vanity/i)
      end
    end

    it 'does not have any matching attachments' do
      attachments = @product.attachments('doesnotcompute')
      attachments.length.should == 0
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
reviewed-0.0.6 spec/product_spec.rb
reviewed-0.0.5 spec/product_spec.rb
reviewed-0.0.4 spec/product_spec.rb
reviewed-0.0.3 spec/product_spec.rb