Sha256: 030c310e6a562d7a701914f3eff60713626ad0dc2e49a5b29787eb1eeea0dab9

Contents?: true

Size: 1.17 KB

Versions: 30

Compression:

Stored size: 1.17 KB

Contents

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

describe Mousetrap::Plan do
  # name: Test
  # billingFrequencyQuantity: "1"
  # code: TEST
  # recurringChargeAmount: "42.00"
  # createdDatetime: "2009-08-25T04:24:34+00:00"
  # id: 5fbb9a84-e27f-102c-a92d-40402145ee8b
  # isActive: "1"
  # billingFrequency: monthly
  # description: Test
  # trialDays: "0"
  # setupChargeCode: TEST_SETUP
  # recurringChargeCode: TEST_RECURRING
  # billingFrequencyUnit: months
  # setupChargeAmount: "0.00"
  # billingFrequencyPer: month

  describe ".all" do
    before do
      Mousetrap::Plan.stub :build_resources_from
    end

    it "gets all plans" do
      Mousetrap::Plan.should_receive(:get_resources).with('plans').and_return('some hash')
      Mousetrap::Plan.all
    end

    it "handles no-plans case" do
      Mousetrap::Plan.stub :get_resources => { 'plans' => nil }
      Mousetrap::Plan.all.should == []
    end

    it "builds resources from the response" do
      Mousetrap::Plan.stub :get_resources => { 'plans' => 'some hash' }
      Mousetrap::Plan.should_receive(:build_resources_from).with({ 'plans' => 'some hash' })
      Mousetrap::Plan.all
    end
  end
end

Version data entries

30 entries across 30 versions & 8 rubygems

Version Path
hashrocket-mousetrap-0.3.0 spec/mousetrap/plan_spec.rb
sproutbox-mousetrap-0.6.4 spec/mousetrap/plan_spec.rb
oel-brenner-mousetrap-0.5.2 spec/mousetrap/plan_spec.rb
cameroncox-mousetrap-0.6.2 spec/mousetrap/plan_spec.rb
cameroncox-mousetrap-0.6.1 spec/mousetrap/plan_spec.rb
ambethia-mousetrap-0.5.1 spec/mousetrap/plan_spec.rb
ryanwood-mousetrap-0.5.7 spec/mousetrap/plan_spec.rb
ryanwood-mousetrap-0.5.6 spec/mousetrap/plan_spec.rb
madebyrocket-mousetrap-0.5.3.8 spec/mousetrap/plan_spec.rb
madebyrocket-mousetrap-0.5.3.7 spec/mousetrap/plan_spec.rb
cameroncox-mousetrap-0.5.3.10 spec/mousetrap/plan_spec.rb
cameroncox-mousetrap-0.5.3.9 spec/mousetrap/plan_spec.rb
cameroncox-mousetrap-0.5.3.8 spec/mousetrap/plan_spec.rb
cameroncox-mousetrap-0.5.3.7 spec/mousetrap/plan_spec.rb
cameroncox-mousetrap-0.5.3.6 spec/mousetrap/plan_spec.rb
cameroncox-mousetrap-0.5.3.5 spec/mousetrap/plan_spec.rb
cameroncox-mousetrap-0.5.3.4 spec/mousetrap/plan_spec.rb
cameroncox-mousetrap-0.5.3.3 spec/mousetrap/plan_spec.rb
cameroncox-mousetrap-0.5.3.2 spec/mousetrap/plan_spec.rb
cameroncox-mousetrap-0.5.3.1 spec/mousetrap/plan_spec.rb