aboutsummaryrefslogtreecommitdiffstats
path: root/spec/helpers
diff options
context:
space:
mode:
Diffstat (limited to 'spec/helpers')
-rw-r--r--spec/helpers/table_builder_helper/custom_links_spec.rb8
-rw-r--r--spec/helpers/table_builder_helper_spec.rb10
2 files changed, 9 insertions, 9 deletions
diff --git a/spec/helpers/table_builder_helper/custom_links_spec.rb b/spec/helpers/table_builder_helper/custom_links_spec.rb
index b64e97527..4b07922a7 100644
--- a/spec/helpers/table_builder_helper/custom_links_spec.rb
+++ b/spec/helpers/table_builder_helper/custom_links_spec.rb
@@ -1,5 +1,3 @@
-require 'spec_helper'
-
describe TableBuilderHelper::CustomLinks do
describe "#actions_after_policy_check" do
it "includes :show" do
@@ -8,19 +6,17 @@ describe TableBuilderHelper::CustomLinks do
build_stubbed(
:user,
organisation: referential.organisation,
- permissions: [
- 'boiv:read-offer'
- ]
),
referential: referential
)
+ stub_policy_scope(referential)
expect(
TableBuilderHelper::CustomLinks.new(
referential,
user_context,
[:show]
- ).actions_after_policy_check
+ ).authorized_actions
).to eq([:show])
end
end
diff --git a/spec/helpers/table_builder_helper_spec.rb b/spec/helpers/table_builder_helper_spec.rb
index d90c14204..4f7c1bd69 100644
--- a/spec/helpers/table_builder_helper_spec.rb
+++ b/spec/helpers/table_builder_helper_spec.rb
@@ -16,8 +16,8 @@ describe TableBuilderHelper, type: :helper do
organisation: referential.organisation,
permissions: [
'referentials.create',
- 'referentials.edit',
- 'referentials.destroy'
+ 'referentials.update',
+ 'referentials.destroy',
]
),
referential: referential
@@ -27,6 +27,7 @@ describe TableBuilderHelper, type: :helper do
referentials = [referential]
allow(referentials).to receive(:model).and_return(Referential)
+ stub_policy_scope(referential)
allow(helper).to receive(:params).and_return({
controller: 'workbenches',
@@ -193,6 +194,7 @@ describe TableBuilderHelper, type: :helper do
companies,
with: CompanyDecorator
)
+ stub_policy_scope(company)
expected = <<-HTML
<table class="table has-search">
@@ -299,8 +301,10 @@ describe TableBuilderHelper, type: :helper do
companies = ModelDecorator.decorate(
companies,
- with: CompanyDecorator
+ with: CompanyDecorator,
+ context: {line_referential: line_referential}
)
+ stub_policy_scope(company)
expected = <<-HTML
<table class="table has-search">