Sha256: 47f6a3da300ee3264aeb735e217a638dc89381a583833e27ec56f49040647ebb

Contents?: true

Size: 1.85 KB

Versions: 21

Compression:

Stored size: 1.85 KB

Contents

require "rails_helper"

RSpec.describe "paid_up/subscriptions/new" do
  include_context 'loaded site'
  context 'when user is logged in as free customer' do
    context "displays a payment form" do
      before do
        view.extend PaidUp::PlansHelper
        view.extend PaidUp::FeaturesHelper

        assign(:current_user, login_subscriber(free_subscriber))
        assign(:plan, professional_plan)
        render
      end
      subject { rendered }
      it { should match /Professional/ }
      it { should have_selector 'form' }
      it { should match /#{paid_up.plan_subscriptions_path(professional_plan.id)}/ }
    end
  end
  context 'when user is logged in as a paid customer' do
    context "displays a payment form" do
      before do
        view.extend PaidUp::PlansHelper
        view.extend PaidUp::FeaturesHelper

        assign(:current_user, login_subscriber(no_ads_subscriber))
        assign(:plan, professional_plan)
        render
      end
      subject { rendered }
      it { should match /Professional/ }
      it { should have_selector 'form' }
      it { should match /#{paid_up.plan_subscriptions_path(professional_plan.id)}/ }
    end
  end
end

RSpec.describe "paid_up/subscriptions/index" do
  include_context 'loaded site'
  context 'when user is logged in' do
    context "displays the details of a user's subscriptions" do
      before do
        view.extend PaidUp::PlansHelper
        view.extend PaidUp::FeaturesHelper

        assign(:current_user, login_subscriber(group_leader_subscriber))
        render
      end
      subject { rendered }
      it { should match /Group Leader/ }
      it { should have_selector 'table.abilities #ad_free_ability .glyphicon-ok'}
      it { should have_selector 'table.abilities #groups_ability .glyphicon-ok'}
      it { should have_selector 'table.abilities #doodads_ability .glyphicon-ok'}
    end
  end
end

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
paid_up-0.9.13 spec/views/paid_up/subscriptions_spec.rb
paid_up-0.9.12 spec/views/paid_up/subscriptions_spec.rb
paid_up-0.9.11 spec/views/paid_up/subscriptions_spec.rb
paid_up-0.9.10 spec/views/paid_up/subscriptions_spec.rb
paid_up-0.9.9 spec/views/paid_up/subscriptions_spec.rb
paid_up-0.9.8 spec/views/paid_up/subscriptions_spec.rb
paid_up-0.9.7 spec/views/paid_up/subscriptions_spec.rb
paid_up-0.9.6 spec/views/paid_up/subscriptions_spec.rb
paid_up-0.9.5 spec/views/paid_up/subscriptions_spec.rb
paid_up-0.9.4 spec/views/paid_up/subscriptions_spec.rb
paid_up-0.9.3 spec/views/paid_up/subscriptions_spec.rb
paid_up-0.9.2 spec/views/paid_up/subscriptions_spec.rb
paid_up-0.9.1 spec/views/paid_up/subscriptions_spec.rb
paid_up-0.9.0 spec/views/paid_up/subscriptions_spec.rb
paid_up-0.8.1 spec/views/paid_up/subscriptions_spec.rb
paid_up-0.7.11 spec/views/paid_up/subscriptions_spec.rb
paid_up-0.7.10 spec/views/paid_up/subscriptions_spec.rb
paid_up-0.7.9 spec/views/paid_up/subscriptions_spec.rb
paid_up-0.7.8 spec/views/paid_up/subscriptions_spec.rb
paid_up-0.7.7 spec/views/paid_up/subscriptions_spec.rb