From 8bd9f7a8899588fae7a552f20390b9c583fa23aa Mon Sep 17 00:00:00 2001 From: Jens Ulferts Date: Wed, 5 Nov 2014 21:39:34 +0100 Subject: [PATCH] employs mocking of Setting --- spec/requests/api/v3/support/authorization.rb | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/spec/requests/api/v3/support/authorization.rb b/spec/requests/api/v3/support/authorization.rb index c402d61349..6b5e079550 100644 --- a/spec/requests/api/v3/support/authorization.rb +++ b/spec/requests/api/v3/support/authorization.rb @@ -48,10 +48,9 @@ shared_examples_for 'handling anonymous user' do |type, path| context 'when access for anonymous user is not allowed' do before do - Setting.login_required = 1 + allow(Setting).to receive(:login_required?).and_return(true) get get_path end - after { Setting.login_required = 0 } it_behaves_like 'unauthenticated access' end