Sha256: 37078f129ce12d93c23963534d85f7735ea0e1bf64d4612b8c4572bba39983f0
Contents?: true
Size: 1.84 KB
Versions: 36
Compression:
Stored size: 1.84 KB
Contents
require "rails_helper" RSpec.describe "paid_up/plans/index" do include_context 'plans and features' include_context 'subscribers' context 'when user is anonymous' do before do view.extend PaidUp::PlansHelper view.extend PaidUp::FeaturesHelper assign(:current_user, access_anonymous) assign(:plans, PaidUp::Plan.subscribable) render end context "displays the subscribable plans" do subject { rendered } it { should match /Free/ } it { should have_css '.free_subscribe_button .btn-success' } it { should match /No Ads/ } it { should have_css '.no_ads_subscribe_button .btn-success' } it { should match /Group Leader/ } it { should have_css '.group_leader_subscribe_button .btn-success' } it { should match /Professional/ } it { should have_css '.professional_subscribe_button .btn-success' } it { should_not match /Error/} it { should_not match /Anonymous/} end end context 'when user is logged in as professional subscriber' do before do view.extend PaidUp::PlansHelper view.extend PaidUp::FeaturesHelper assign(:current_user, login_subscriber(professional_subscriber)) assign(:plans, PaidUp::Plan.subscribable) render end context "displays all the plans" do subject { rendered } it { should match /Free/ } it { should have_css '.free_subscribe_button .btn-danger' } it { should match /No Ads/ } it { should have_css '.no_ads_subscribe_button .btn-danger' } it { should match /Group Leader/ } it { should have_css '.group_leader_subscribe_button .btn-danger' } it { should match /Professional/ } it { should have_css '.professional_subscribe_button .btn-disabled' } it { should_not match /Error/} it { should_not match /Anonymous/} end end end
Version data entries
36 entries across 36 versions & 1 rubygems