From e53aa88c442bd0057c4e0ae66e2684d62d3193ed Mon Sep 17 00:00:00 2001 From: Robert Date: Wed, 5 Jul 2017 11:54:33 +0200 Subject: Refs: #3478@1h; - All permissions tied to `!archived?` - Tests adapted - Policies refactored ? Is `create?` permission bound to `organisation_match?` --- spec/helpers/table_builder_helper/custom_links_spec.rb | 1 + spec/helpers/table_builder_helper_spec.rb | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) (limited to 'spec/helpers') 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