Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dzaporozhets@gitlab.com>2014-12-07 23:51:54 +0300
committerDmitriy Zaporozhets <dzaporozhets@gitlab.com>2014-12-07 23:51:54 +0300
commitbbf9953b99d59801c72dd7b9550ee149ca77bfcf (patch)
tree8c7da4eaff1677051c7ebbd5fca79d00bf4239a2 /spec
parent1812c1d4de8e0a1041b265ff51d38037ad238e56 (diff)
parent3f1fad5f090ba77f202ae9ad1adbad394deef4db (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.rb10
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!