diff options
Diffstat (limited to 'spec')
-rw-r--r-- | spec/helpers/application_helper_spec.rb | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/spec/helpers/application_helper_spec.rb b/spec/helpers/application_helper_spec.rb index 6401ec0710a..6a11414a023 100644 --- a/spec/helpers/application_helper_spec.rb +++ b/spec/helpers/application_helper_spec.rb @@ -67,10 +67,9 @@ describe ApplicationHelper do end it "should call gravatar_icon when no avatar is present" do - user = create(:user) + user = create(:user, email: 'test@example.com') user.save! - allow(self).to receive(:gravatar_icon).and_return('gravatar_method_called') - avatar_icon(user.email).to_s.should == "gravatar_method_called" + avatar_icon(user.email).to_s.should == "http://www.gravatar.com/avatar/55502f40dc8b7c769880b10874abc9d0?s=40&d=mm" end end @@ -87,12 +86,12 @@ describe ApplicationHelper do end it "should return default gravatar url" do - allow(self).to receive(:request).and_return(double(:ssl? => false)) + Gitlab.config.gitlab.stub(https: false) gravatar_icon(user_email).should match('http://www.gravatar.com/avatar/b58c6f14d292556214bd64909bcdb118') end it "should use SSL when appropriate" do - allow(self).to receive(:request).and_return(double(:ssl? => true)) + Gitlab.config.gitlab.stub(https: true) gravatar_icon(user_email).should match('https://secure.gravatar.com') end |