Skip to content
Snippets Groups Projects
Verified Commit e8f222e3 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets
Browse files

Fix helper specs

parent a7345e36
No related branches found
No related tags found
No related merge requests found
Loading
@@ -67,10 +67,9 @@ describe ApplicationHelper do
Loading
@@ -67,10 +67,9 @@ describe ApplicationHelper do
end end
   
it "should call gravatar_icon when no avatar is present" do it "should call gravatar_icon when no avatar is present" do
user = create(:user) user = create(:user, email: 'test@example.com')
user.save! user.save!
allow(self).to receive(:gravatar_icon).and_return('gravatar_method_called') avatar_icon(user.email).to_s.should == "http://www.gravatar.com/avatar/55502f40dc8b7c769880b10874abc9d0?s=40&d=mm"
avatar_icon(user.email).to_s.should == "gravatar_method_called"
end end
end end
   
Loading
@@ -87,12 +86,12 @@ describe ApplicationHelper do
Loading
@@ -87,12 +86,12 @@ describe ApplicationHelper do
end end
   
it "should return default gravatar url" do 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') gravatar_icon(user_email).should match('http://www.gravatar.com/avatar/b58c6f14d292556214bd64909bcdb118')
end end
   
it "should use SSL when appropriate" do 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') gravatar_icon(user_email).should match('https://secure.gravatar.com')
end end
   
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment