aboutsummaryrefslogtreecommitdiffstats
path: root/spec/helpers
diff options
context:
space:
mode:
authorRobert2017-07-05 11:54:33 +0200
committerRobert2017-07-05 11:59:06 +0200
commite53aa88c442bd0057c4e0ae66e2684d62d3193ed (patch)
tree1ba7c8c082dde92ba215659fde9293e231e7c7df /spec/helpers
parent841bd65847066e92bf5a4d6de112fed1ada73c1c (diff)
downloadchouette-core-e53aa88c442bd0057c4e0ae66e2684d62d3193ed.tar.bz2
Refs: #3478@1h;
- All permissions tied to `!archived?` - Tests adapted - Policies refactored ? Is `create?` permission bound to `organisation_match?`
Diffstat (limited to 'spec/helpers')
-rw-r--r--spec/helpers/table_builder_helper/custom_links_spec.rb1
-rw-r--r--spec/helpers/table_builder_helper_spec.rb5
2 files changed, 4 insertions, 2 deletions
diff --git a/spec/helpers/table_builder_helper/custom_links_spec.rb b/spec/helpers/table_builder_helper/custom_links_spec.rb
index bd0bd4fcf..4b07922a7 100644
--- a/spec/helpers/table_builder_helper/custom_links_spec.rb
+++ b/spec/helpers/table_builder_helper/custom_links_spec.rb
@@ -10,6 +10,7 @@ describe TableBuilderHelper::CustomLinks do
referential: referential
)
+ stub_policy_scope(referential)
expect(
TableBuilderHelper::CustomLinks.new(
referential,
diff --git a/spec/helpers/table_builder_helper_spec.rb b/spec/helpers/table_builder_helper_spec.rb
index 6b505c940..4afd0774c 100644
--- a/spec/helpers/table_builder_helper_spec.rb
+++ b/spec/helpers/table_builder_helper_spec.rb
@@ -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,7 +194,7 @@ describe TableBuilderHelper, type: :helper do
companies,
with: CompanyDecorator
)
- allow(CompanyDecorator).to receive(:where).with(id: company.id).and_return double.as_null_object
+ stub_policy_scope(company)
expected = <<-HTML
<table class="table has-search">
@@ -303,7 +304,7 @@ describe TableBuilderHelper, type: :helper do
with: CompanyDecorator,
context: {line_referential: line_referential}
)
- allow(CompanyDecorator).to receive(:where).with(id: company.id).and_return double.as_null_object
+ stub_policy_scope(company)
expected = <<-HTML
<table class="table has-search">