Sha256: a6fa1910b126a3a6bbb52dca9ae18f62c9f0ed424c2b9aa0a579c095019b7934

Contents?: true

Size: 1.07 KB

Versions: 5

Compression:

Stored size: 1.07 KB

Contents

require 'spec_helper'

describe 'Plans' do

  describe 'GET /subscriptions/plans' do
    before(:each) do
      @plan = Factory(:plan, :name => "Gold", :price => 20)
      @plan2 = Factory(:plan, :name => "Silver", :price => 10)
      @contact_info = Factory.build(:contact_info)

      @credit_card = Factory.build(:credit_card)

      @subscription = Factory.build(:subscription, :contact_info => @contact_info, :plan => @plan, :credit_card => @credit_card)

      @user = Factory(:user, :subscription => @subscription)
    end
    it 'should not show current plan on downgrade' do
      visit edit_subscription_plan_path
      page.should have_content("Silver")
      
      page.should have_content("You are currently subscribed to this plan")
      
    end
    it 'should set downgrade_to_plan on downgrade' do
      visit edit_subscription_plan_path
      click_on("Downgrade")
      page.should have_content("Plan was successfully changed.")
      @subscription.reload
      @subscription.plan.should == @plan
      @subscription.downgrade_to_plan.should == @plan2
    end
    
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
saasaparilla-0.2.2 spec/requests/subscription_plans_spec.rb
saasaparilla-0.2.1 spec/requests/subscription_plans_spec.rb
saasaparilla-0.1.8 spec/requests/subscription_plans_spec.rb
saasaparilla-0.1.7 spec/requests/subscription_plans_spec.rb
saasaparilla-0.1.6 spec/requests/subscription_plans_spec.rb