Sha256: b65dda11bc175981d38bc1640da2e82ef8d4cfbb21c9d2fc7cc7e2bc00e70a23
Contents?: true
Size: 1.09 KB
Versions: 32
Compression:
Stored size: 1.09 KB
Contents
require File.expand_path(File.dirname(__FILE__) + "/../spec_helper") describe Braintree::Discount do describe "self.all" do it "gets all discounts" do id = rand(36**8).to_s(36) expected = { :amount => "100.00", :description => "some description", :id => id, :kind => "discount", :name => "ruby_discount", :never_expires => false, :number_of_billing_cycles => 1 } create_modification_for_tests(expected) discounts = Braintree::Discount.all discount = discounts.select { |discount| discount.id == id }.first discount.should_not be_nil discount.amount.should == BigDecimal(expected[:amount]) discount.created_at.should_not be_nil discount.description.should == expected[:description] discount.kind.should == expected[:kind] discount.name.should == expected[:name] discount.never_expires.should == expected[:never_expires] discount.number_of_billing_cycles.should == expected[:number_of_billing_cycles] discount.updated_at.should_not be_nil end end end
Version data entries
32 entries across 32 versions & 1 rubygems