Commit e8f222e3 authored by Dmitriy Zaporozhets's avatar Dmitriy Zaporozhets

Fix helper specs

Signed-off-by: default avatarDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
parent a7345e36
...@@ -67,10 +67,9 @@ describe ApplicationHelper do ...@@ -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
...@@ -87,12 +86,12 @@ describe ApplicationHelper do ...@@ -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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment