Sha256: 8b31239119823f2f454e6e17ceda5ca227744e7cfdc8c22ad9a819efcaf1b8bd

Contents?: true

Size: 1.31 KB

Versions: 21

Compression:

Stored size: 1.31 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
    subject {
      new_group = Group.new({title: 'Saved Group'})
      new_group.save_with_owner(professional_subscriber)
      new_group.reload.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

21 entries across 21 versions & 1 rubygems

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