Sha256: b50ebff59d65fe1156852e4c2288f6294419e13d416848ec0a91c1254b1b1e36

Contents?: true

Size: 826 Bytes

Versions: 5

Compression:

Stored size: 826 Bytes

Contents

require 'spec_helper'

describe Spree::PermissionSets::StockDisplay 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(:display, Spree::StockItem) }
    it { is_expected.to be_able_to(:display, Spree::StockTransfer) }
    it { is_expected.to be_able_to(:admin, Spree::StockItem) }
    it { is_expected.to be_able_to(:admin, Spree::StockTransfer) }
  end

  context "when not activated" do
    it { is_expected.not_to be_able_to(:display, Spree::StockItem) }
    it { is_expected.not_to be_able_to(:display, Spree::StockTransfer) }
    it { is_expected.not_to be_able_to(:admin, Spree::StockItem) }
    it { is_expected.not_to be_able_to(:admin, Spree::StockTransfer) }
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
solidus_core-1.0.7 spec/models/spree/permission_sets/stock_display_spec.rb
solidus_core-1.0.6 spec/models/spree/permission_sets/stock_display_spec.rb
solidus_core-1.0.5 spec/models/spree/permission_sets/stock_display_spec.rb
solidus_core-1.0.4 spec/models/spree/permission_sets/stock_display_spec.rb
solidus_core-1.0.3 spec/models/spree/permission_sets/stock_display_spec.rb