Sha256: b1c264b65f7ade645913cca8c6394a9ec79f96e9a518c67ba92c628a1876d1ec

Contents?: true

Size: 1.7 KB

Versions: 17

Compression:

Stored size: 1.7 KB

Contents

require 'spec_helper'

describe Spree::PermissionSets::ProductManagement do
  let(:ability) { DummyAbility.new }

  subject { ability }

  context "when activated" do
    before do
      described_class.new(ability).activate!
    end

    it { is_expected.to be_able_to(:manage, Spree::Product) }
    it { is_expected.to be_able_to(:manage, Spree::Image) }
    it { is_expected.to be_able_to(:manage, Spree::Variant) }
    it { is_expected.to be_able_to(:manage, Spree::OptionValue) }
    it { is_expected.to be_able_to(:manage, Spree::ProductProperty) }
    it { is_expected.to be_able_to(:manage, Spree::OptionType) }
    it { is_expected.to be_able_to(:manage, Spree::Property) }
    it { is_expected.to be_able_to(:manage, Spree::Prototype) }
    it { is_expected.to be_able_to(:manage, Spree::Taxonomy) }
    it { is_expected.to be_able_to(:manage, Spree::Taxon) }
    it { is_expected.to be_able_to(:manage, Spree::Classification) }
  end

  context "when not activated" do
    it { is_expected.not_to be_able_to(:manage, Spree::Product) }
    it { is_expected.not_to be_able_to(:manage, Spree::Image) }
    it { is_expected.not_to be_able_to(:manage, Spree::Variant) }
    it { is_expected.not_to be_able_to(:manage, Spree::OptionValue) }
    it { is_expected.not_to be_able_to(:manage, Spree::ProductProperty) }
    it { is_expected.not_to be_able_to(:manage, Spree::OptionType) }
    it { is_expected.not_to be_able_to(:manage, Spree::Property) }
    it { is_expected.not_to be_able_to(:manage, Spree::Prototype) }
    it { is_expected.not_to be_able_to(:manage, Spree::Taxonomy) }
    it { is_expected.not_to be_able_to(:manage, Spree::Taxon) }
    it { is_expected.not_to be_able_to(:manage, Spree::Classification) }
  end
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
solidus_core-2.0.3 spec/models/spree/permission_sets/product_management_spec.rb
solidus_core-1.4.2 spec/models/spree/permission_sets/product_management_spec.rb
solidus_core-1.3.2 spec/models/spree/permission_sets/product_management_spec.rb
solidus_core-2.0.2 spec/models/spree/permission_sets/product_management_spec.rb
solidus_core-1.4.1 spec/models/spree/permission_sets/product_management_spec.rb
solidus_core-2.0.1 spec/models/spree/permission_sets/product_management_spec.rb
solidus_core-2.0.0 spec/models/spree/permission_sets/product_management_spec.rb
solidus_core-1.4.0 spec/models/spree/permission_sets/product_management_spec.rb
solidus_core-2.0.0.rc1 spec/models/spree/permission_sets/product_management_spec.rb
solidus_core-1.4.0.rc1 spec/models/spree/permission_sets/product_management_spec.rb
solidus_core-2.0.0.beta1 spec/models/spree/permission_sets/product_management_spec.rb
solidus_core-1.4.0.beta1 spec/models/spree/permission_sets/product_management_spec.rb
solidus_core-1.3.1 spec/models/spree/permission_sets/product_management_spec.rb
solidus_core-1.3.0 spec/models/spree/permission_sets/product_management_spec.rb
solidus_core-1.3.0.rc2 spec/models/spree/permission_sets/product_management_spec.rb
solidus_core-1.3.0.rc1 spec/models/spree/permission_sets/product_management_spec.rb
solidus_core-1.3.0.beta1 spec/models/spree/permission_sets/product_management_spec.rb