Fix helper specs

Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
This commit is contained in:
Dmitriy Zaporozhets 2014-06-13 19:35:21 +03:00
parent a7345e368a
commit e8f222e39c
No known key found for this signature in database
GPG Key ID: 627C5F589F467F17
1 changed files with 4 additions and 5 deletions

View File

@ -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