diff options
author | Dmitriy Zaporozhets <dzaporozhets@gitlab.com> | 2014-12-07 23:51:54 +0300 |
---|---|---|
committer | Dmitriy Zaporozhets <dzaporozhets@gitlab.com> | 2014-12-07 23:51:54 +0300 |
commit | bbf9953b99d59801c72dd7b9550ee149ca77bfcf (patch) | |
tree | 8c7da4eaff1677051c7ebbd5fca79d00bf4239a2 /spec | |
parent | 1812c1d4de8e0a1041b265ff51d38037ad238e56 (diff) | |
parent | 3f1fad5f090ba77f202ae9ad1adbad394deef4db (diff) |
Merge branch 'attachment_url_shouldnot_be_overwritten' into 'master'
Attachment url should not be overwritten
Fixes #1786
See merge request !1308
Diffstat (limited to 'spec')
-rw-r--r-- | spec/helpers/application_helper_spec.rb | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/spec/helpers/application_helper_spec.rb b/spec/helpers/application_helper_spec.rb index 2db67cfdf95..07dd33b211b 100644 --- a/spec/helpers/application_helper_spec.rb +++ b/spec/helpers/application_helper_spec.rb @@ -66,6 +66,16 @@ describe ApplicationHelper do avatar_icon(user.email).to_s.should match("/uploads/user/avatar/#{ user.id }/gitlab_logo.png") 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 user = create(:user, email: 'test@example.com') user.save! |