Sha256: 7c73dd907b0e4a7f4a4d0eb6f30184f478ff9a3058ea292de9bc5003712dafae

Contents?: true

Size: 1.93 KB

Versions: 19

Compression:

Stored size: 1.93 KB

Contents

# frozen_string_literal: true

require 'rails_helper'

RSpec.describe 'paid_up/subscriptions/new' do
  include_context 'loaded site'

  before do
    view.extend PaidUp::PlansHelper
    view.extend PaidUp::FeaturesHelper
    view.extend BootstrapLeather::ApplicationHelper
  end

  context 'when user is logged in as free customer' do
    context 'displays a payment form' do
      before do
        assign(:current_user, login_subscriber(free_subscriber))
        assign(:plan, professional_plan)
        render
      end
      subject { rendered }
      it { should include 'Professional' }
      it { should have_selector 'form' }
      it do
        should include paid_up.plan_subscriptions_path(professional_plan.id)
      end
    end
  end
  context 'when user is logged in as a paid customer' do
    context 'displays a payment form' do
      before do
        assign(:current_user, login_subscriber(no_ads_subscriber))
        assign(:plan, professional_plan)
        render
      end
      subject { rendered }
      it { should include 'Professional' }
      it { should have_selector 'form' }
      it do
        should include paid_up.plan_subscriptions_path(professional_plan.id)
      end
    end
  end
end

RSpec.describe 'paid_up/subscriptions/index' do
  include_context 'loaded site'

  before do
    view.extend PaidUp::PlansHelper
    view.extend PaidUp::FeaturesHelper
    view.extend BootstrapLeather::ApplicationHelper
  end

  context 'when user is logged in' do
    context "displays the details of a user's subscriptions" do
      before do
        assign(:current_user, login_subscriber(leader_subscriber))
        render
      end
      subject { rendered }
      it { should include 'Group Leader' }
      it { should have_css 'table.abilities #ad_free_ability .glyphicon-ok' }
      it { should have_css 'table.abilities #groups_ability .glyphicon-ok' }
      it { should have_css 'table.abilities #doodads_ability .glyphicon-ok' }
    end
  end
end

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
paid_up-0.13.22 spec/views/paid_up/subscriptions_spec.rb
paid_up-0.13.21 spec/views/paid_up/subscriptions_spec.rb
paid_up-0.13.17 spec/views/paid_up/subscriptions_spec.rb
paid_up-0.13.16 spec/views/paid_up/subscriptions_spec.rb
paid_up-0.13.14 spec/views/paid_up/subscriptions_spec.rb
paid_up-0.13.13 spec/views/paid_up/subscriptions_spec.rb
paid_up-0.13.12 spec/views/paid_up/subscriptions_spec.rb
paid_up-0.13.11 spec/views/paid_up/subscriptions_spec.rb
paid_up-0.13.10 spec/views/paid_up/subscriptions_spec.rb
paid_up-0.13.9 spec/views/paid_up/subscriptions_spec.rb
paid_up-0.13.8 spec/views/paid_up/subscriptions_spec.rb
paid_up-0.13.7 spec/views/paid_up/subscriptions_spec.rb
paid_up-0.13.6 spec/views/paid_up/subscriptions_spec.rb
paid_up-0.13.5 spec/views/paid_up/subscriptions_spec.rb
paid_up-0.13.4 spec/views/paid_up/subscriptions_spec.rb
paid_up-0.13.3 spec/views/paid_up/subscriptions_spec.rb
paid_up-0.13.2 spec/views/paid_up/subscriptions_spec.rb
paid_up-0.13.1 spec/views/paid_up/subscriptions_spec.rb
paid_up-0.13.0 spec/views/paid_up/subscriptions_spec.rb