Sha256: 53da9da81a0e6a5e1f77f63125a33b0db74338e67061def6cd45fdafd441a2a9

Contents?: true

Size: 781 Bytes

Versions: 5

Compression:

Stored size: 781 Bytes

Contents

require File.expand_path(File.dirname(__FILE__) + '/spec_helper')

describe Chargify::Product do
  
  context 'find by handle' do
    before do
      @handle = 'handle1'
      @existing_product = Factory(:product, :handle => @handle, :id => FactoryGirl.generate(:product_id))
      FakeWeb.register_uri(:get, "#{test_domain}/products/lookup.xml?handle=#{@existing_product.handle}", :body => @existing_product.attributes.to_xml)
    end

    it 'finds the correct product by handle' do
      product = Chargify::Product.find_by_handle(@handle)
      product.should eql(@existing_product)
    end
    
    it 'is an instance of Chargify::Product' do
      product = Chargify::Product.find_by_handle(@handle)
      product.should be_instance_of(Chargify::Product)
    end  
  end

end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
chargify_api_ares-0.4.4 spec/product_spec.rb
chargify_api_ares-0.4.3 spec/product_spec.rb
chargify_api_ares-0.4.2 spec/product_spec.rb
chargify_api_ares-0.4.1 spec/product_spec.rb
chargify_api_ares-0.4.0 spec/product_spec.rb