Sha256: 48cb83c67faf832cb99a6eccfd003e0f6973857305582d13d62eb9a1d7de4c00

Contents?: true

Size: 773 Bytes

Versions: 13

Compression:

Stored size: 773 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 => Factory.next(: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

13 entries across 13 versions & 4 rubygems

Version Path
vitalish-chargify_api_ares-0.3.9 spec/product_spec.rb
chargify_api_ares-0.3.9 spec/product_spec.rb
chargify_api_ares-0.3.8 spec/product_spec.rb
chargify_api_ares-0.3.7 spec/product_spec.rb
chargify_api_ares-0.3.5 spec/product_spec.rb
chargify_api_ares-0.3.4 spec/product_spec.rb
micah_chargify_api_ares-0.3.4 spec/product_spec.rb
chargify_api_ares-0.3.3 spec/product_spec.rb
chargify_api_ares-0.3.2 spec/product_spec.rb
ninjabutton_chargify_api_ares-0.3.1 spec/product_spec.rb
chargify_api_ares-0.3.1 spec/product_spec.rb
chargify_api_ares-0.2.3 spec/product_spec.rb
chargify_api_ares-0.2.2 spec/product_spec.rb