diff options
author | sue445 <sue445@sue445.net> | 2015-03-01 02:07:53 +0900 |
---|---|---|
committer | sue445 <sue445@sue445.net> | 2015-03-01 10:13:01 +0900 |
commit | 51abeaa1bc93862a4d15506a590704f9fc56cfd6 (patch) | |
tree | 745adc2f9567b8cf22c9b2cbe6f399039abb019e /spec/helpers/application_helper_spec.rb | |
parent | 7fef8456e8bc92adb0de3f2bc7192e3bedfce47d (diff) | |
download | gitlab-ce-51abeaa1bc93862a4d15506a590704f9fc56cfd6.tar.gz |
Expose avatar_url in projects API
* Impl Project#avatar_url
* Refactor ApplicationHelper: Use Project#avatar_url
* Update changelog
Diffstat (limited to 'spec/helpers/application_helper_spec.rb')
-rw-r--r-- | spec/helpers/application_helper_spec.rb | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/spec/helpers/application_helper_spec.rb b/spec/helpers/application_helper_spec.rb index 9d99b6e33cb..de491ce8a58 100644 --- a/spec/helpers/application_helper_spec.rb +++ b/spec/helpers/application_helper_spec.rb @@ -64,8 +64,9 @@ describe ApplicationHelper do project = create(:project) project.avatar = File.open(avatar_file_path) project.save! + avatar_url = "http://localhost/uploads/project/avatar/#{ project.id }/gitlab_logo.png" expect(project_icon("#{project.namespace.to_param}/#{project.to_param}").to_s).to eq( - "<img alt=\"Gitlab logo\" src=\"/uploads/project/avatar/#{ project.id }/gitlab_logo.png\" />" + "<img alt=\"Gitlab logo\" src=\"#{avatar_url}\" />" ) end @@ -75,8 +76,9 @@ describe ApplicationHelper do allow_any_instance_of(Project).to receive(:avatar_in_git).and_return(true) + avatar_url = 'http://localhost' + namespace_project_avatar_path(project.namespace, project) expect(project_icon("#{project.namespace.to_param}/#{project.to_param}").to_s).to match( - image_tag(namespace_project_avatar_path(project.namespace, project))) + image_tag(avatar_url)) end end |