From 9d52ccea7b00b957bf6cf67a44029912ee6b171f Mon Sep 17 00:00:00 2001 From: Robert Date: Tue, 4 Jul 2017 18:59:26 +0200 Subject: Refs: #3478@3h; Policy Cleanup and Providing Policy and permissions for all models and actions - ApplicationPolicy nondestructive permission depend on model existance - ApplicationPolicy destructive permission default to `false` - Tied Policy permissions at ApplicationPolicy Level: edit? → update?, new? → create?, index? → show? - ApplicationPolicy convenience methods `delete?` & `authorizes_action?(action)` - Refactoring of `spec/helpers/table_builder_helper_spec.rb` accordingly - Stubbing scope in specs (cannot switch to referential with a `build_stubbed` instance) --- spec/helpers/table_builder_helper_spec.rb | 2 ++ 1 file changed, 2 insertions(+) (limited to 'spec/helpers') diff --git a/spec/helpers/table_builder_helper_spec.rb b/spec/helpers/table_builder_helper_spec.rb index 6d7b60366..6b505c940 100644 --- a/spec/helpers/table_builder_helper_spec.rb +++ b/spec/helpers/table_builder_helper_spec.rb @@ -193,6 +193,7 @@ describe TableBuilderHelper, type: :helper do companies, with: CompanyDecorator ) + allow(CompanyDecorator).to receive(:where).with(id: company.id).and_return double.as_null_object expected = <<-HTML