Commit e8f222e39c5f7124bd604246c8d2502181760888

Authored by Dmitriy Zaporozhets
1 parent a7345e36

Fix helper specs

Signed-off-by: Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>
Showing 1 changed file with 4 additions and 5 deletions   Show diff stats
spec/helpers/application_helper_spec.rb
... ... @@ -67,10 +67,9 @@ describe ApplicationHelper do
67 67 end
68 68  
69 69 it "should call gravatar_icon when no avatar is present" do
70   - user = create(:user)
  70 + user = create(:user, email: 'test@example.com')
71 71 user.save!
72   - allow(self).to receive(:gravatar_icon).and_return('gravatar_method_called')
73   - avatar_icon(user.email).to_s.should == "gravatar_method_called"
  72 + avatar_icon(user.email).to_s.should == "http://www.gravatar.com/avatar/55502f40dc8b7c769880b10874abc9d0?s=40&d=mm"
74 73 end
75 74 end
76 75  
... ... @@ -87,12 +86,12 @@ describe ApplicationHelper do
87 86 end
88 87  
89 88 it "should return default gravatar url" do
90   - allow(self).to receive(:request).and_return(double(:ssl? => false))
  89 + Gitlab.config.gitlab.stub(https: false)
91 90 gravatar_icon(user_email).should match('http://www.gravatar.com/avatar/b58c6f14d292556214bd64909bcdb118')
92 91 end
93 92  
94 93 it "should use SSL when appropriate" do
95   - allow(self).to receive(:request).and_return(double(:ssl? => true))
  94 + Gitlab.config.gitlab.stub(https: true)
96 95 gravatar_icon(user_email).should match('https://secure.gravatar.com')
97 96 end
98 97  
... ...