Sha256: bda9a2247221afedae25f3784c6c5722f553c264b277a31010fca72f14b5da9c

Contents?: true

Size: 1.34 KB

Versions: 16

Compression:

Stored size: 1.34 KB

Contents

require 'rails_helper'
require 'cancan/matchers'

describe Group do
  include_context 'loaded site'

  describe '#owners' do
    subject { first_group.owners }
    it { should include group_leader_subscriber }
    it { should_not include professional_subscriber }
  end

  describe '#save_with_owner' do
    let(:new_group) do
      group = Group.new(title: 'Saved Group')
                   .save_with_owner(professional_subscriber)
      group.reload
    end
    subject { new_group.owners }
    it { should include professional_subscriber }
  end

  describe '#owners_enabled_count' do
    describe 'when limited' do
      subject { first_group.owners_enabled_count }
      it { should eq 5 }
    end
    describe 'when unlimited' do
      subject { second_group.owners_enabled_count }
      it { should eq PaidUp::Unlimited.to_i }
    end
  end

  describe '#owners_records' do
    subject { second_group.owners_records }
    it { should include third_group }
    it { should_not include first_group }
  end

  describe '#owners_records_count' do
    subject { second_group.owners_records_count }
    it { should eq 2 }
  end

  describe '#enabled' do
    describe 'when true' do
      subject { first_group.enabled }
      it { should eq true }
    end
    describe 'when false' do
      subject { disabled_group.enabled }
      it { should eq false }
    end
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
paid_up-0.11.7 spec/models/group_spec.rb
paid_up-0.11.6 spec/models/group_spec.rb
paid_up-0.11.5 spec/models/group_spec.rb
paid_up-0.11.4 spec/models/group_spec.rb
paid_up-0.11.3 spec/models/group_spec.rb
paid_up-0.11.2 spec/models/group_spec.rb
paid_up-0.11.1 spec/models/group_spec.rb
paid_up-0.11.0 spec/models/group_spec.rb
paid_up-0.10.4 spec/models/group_spec.rb
paid_up-0.10.3 spec/models/group_spec.rb
paid_up-0.10.2 spec/models/group_spec.rb
paid_up-0.10.1 spec/models/group_spec.rb
paid_up-0.10.0 spec/models/group_spec.rb
paid_up-0.9.16 spec/models/group_spec.rb
paid_up-0.9.15 spec/models/group_spec.rb
paid_up-0.9.14 spec/models/group_spec.rb