diff options
Diffstat (limited to 'spec/helpers/application_helper_spec.rb')
-rw-r--r-- | spec/helpers/application_helper_spec.rb | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/spec/helpers/application_helper_spec.rb b/spec/helpers/application_helper_spec.rb index 3307ac776fc..f63774e10c0 100644 --- a/spec/helpers/application_helper_spec.rb +++ b/spec/helpers/application_helper_spec.rb @@ -76,8 +76,8 @@ describe ApplicationHelper do end it 'should return an url for the avatar with relative url' do - Gitlab.config.gitlab.stub(relative_url_root: '/gitlab') - Gitlab.config.gitlab.stub(url: Settings.send(:build_gitlab_url)) + allow(Gitlab.config.gitlab).to receive(:relative_url_root).and_return('/gitlab') + allow(Gitlab.config.gitlab).to receive(:url).and_return(Settings.send(:build_gitlab_url)) user = create(:user) user.avatar = File.open(avatar_file_path) @@ -97,7 +97,7 @@ describe ApplicationHelper do let(:user_email) { 'user@email.com' } it 'should return a generic avatar path when Gravatar is disabled' do - ApplicationSetting.any_instance.stub(gravatar_enabled?: false) + allow_any_instance_of(ApplicationSetting).to receive(:gravatar_enabled?).and_return(false) expect(gravatar_icon(user_email)).to match('no_avatar.png') end @@ -106,13 +106,13 @@ describe ApplicationHelper do end it 'should return default gravatar url' do - Gitlab.config.gitlab.stub(https: false) + allow(Gitlab.config.gitlab).to receive(:https).and_return(false) url = 'http://www.gravatar.com/avatar/b58c6f14d292556214bd64909bcdb118' expect(gravatar_icon(user_email)).to match(url) end it 'should use SSL when appropriate' do - Gitlab.config.gitlab.stub(https: true) + allow(Gitlab.config.gitlab).to receive(:https).and_return(true) expect(gravatar_icon(user_email)).to match('https://secure.gravatar.com') end |