aboutsummaryrefslogtreecommitdiffstats
path: root/spec/policies/purchase_window_policy_spec.rb
blob: 184152cec249d6db4f5ff807010f42eec0a9e95d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
RSpec.describe PurchaseWindowPolicy, type: :policy do

  let( :record ){ build_stubbed :purchase_window }
  before { stub_policy_scope(record) }

  permissions :create? do
    it_behaves_like 'permitted policy and same organisation', "purchase_windows.create", archived_and_finalised: true
  end
  permissions :destroy? do
    it_behaves_like 'permitted policy and same organisation', "purchase_windows.destroy", archived_and_finalised: true
  end
  permissions :update? do
    it_behaves_like 'permitted policy and same organisation', "purchase_windows.update", archived_and_finalised: true
  end
end