Commit 3f1fad5f authored by Marin Jankovski's avatar Marin Jankovski

Add an avatar_url spec when relative url is set.

parent db585009
...@@ -66,6 +66,16 @@ describe ApplicationHelper do ...@@ -66,6 +66,16 @@ describe ApplicationHelper do
avatar_icon(user.email).to_s.should match("/uploads/user/avatar/#{ user.id }/gitlab_logo.png") avatar_icon(user.email).to_s.should match("/uploads/user/avatar/#{ user.id }/gitlab_logo.png")
end end
it "should return an url for the avatar with relative url" do
Gitlab.config.gitlab.stub(relative_url_root: "/gitlab")
Gitlab.config.gitlab.stub(url: Settings.send(:build_gitlab_url))
user = create(:user)
user.avatar = File.open(avatar_file_path)
user.save!
avatar_icon(user.email).to_s.should match("/gitlab//uploads/user/avatar/#{ user.id }/gitlab_logo.png")
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, email: 'test@example.com') user = create(:user, email: 'test@example.com')
user.save! user.save!
......
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