From 74e94da83d6ea64dcb1e70e69c2fef046453e4a1 Mon Sep 17 00:00:00 2001 From: Teddy Wing Date: Thu, 6 Jul 2017 10:51:00 +0200 Subject: TableBuilderHelper: Fix specs which mock `current_referential` These two specs were failing because of the line: current_referential ||= nil which would set `current_referential` to `nil` even after updating the object being stubbed to `helper`. Change the specs to stub the method on the correct object now that `TableBuilderHelper::URL` doesn't depend on `current_referential`. Update the faulty line in question to not clobber `current_referential`, but still give us the `nil` value we were looking for when the helper method isn't defined. Refs #3479 --- spec/helpers/table_builder_helper_spec.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'spec/helpers') diff --git a/spec/helpers/table_builder_helper_spec.rb b/spec/helpers/table_builder_helper_spec.rb index 67980fc2c..d90c14204 100644 --- a/spec/helpers/table_builder_helper_spec.rb +++ b/spec/helpers/table_builder_helper_spec.rb @@ -176,7 +176,7 @@ describe TableBuilderHelper, type: :helper do referential: referential ) allow(helper).to receive(:current_user).and_return(user_context) - allow(TableBuilderHelper::URL).to receive(:current_referential) + allow(helper).to receive(:current_referential) .and_return(referential) companies = [company] @@ -284,7 +284,7 @@ describe TableBuilderHelper, type: :helper do referential: referential ) allow(helper).to receive(:current_user).and_return(user_context) - allow(TableBuilderHelper::URL).to receive(:current_referential) + allow(helper).to receive(:current_referential) .and_return(referential) companies = [company] -- cgit v1.2.3