From fe94254571a1de4a27a5440356345680a639e9fc Mon Sep 17 00:00:00 2001 From: Stan Hu Date: Mon, 22 Jun 2015 11:00:17 -0700 Subject: [PATCH] Fix avatar tests to use banana_sample.gif since SVG is not supported --- README.md | 4 ++-- features/steps/groups.rb | 6 +++--- features/steps/profile/profile.rb | 6 +++--- features/steps/project/project.rb | 6 +++--- spec/helpers/application_helper_spec.rb | 12 ++++++------ spec/helpers/groups_helper.rb | 4 ++-- 6 files changed, 19 insertions(+), 19 deletions(-) diff --git a/README.md b/README.md index 85ea5c876af..336196a623d 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ The source of GitLab Community Edition is [hosted on GitLab.com](https://gitlab.com/gitlab-org/gitlab-ce/) and there are mirrors to make [contributing](CONTRIBUTING.md) as easy as possible. -# ![logo](https://about.gitlab.com/images/gitlab_logo.png) GitLab +# ![logo](https://about.gitlab.com/images/logo.svg) GitLab ## Open source software to collaborate on code @@ -101,4 +101,4 @@ Please see [Getting help for GitLab](https://about.gitlab.com/getting-help/) on ## Is it awesome? Thanks for [asking this question](https://twitter.com/supersloth/status/489462789384056832) Joshua. -[These people](https://twitter.com/gitlab/favorites) seem to like it. \ No newline at end of file +[These people](https://twitter.com/gitlab/favorites) seem to like it. diff --git a/features/steps/groups.rb b/features/steps/groups.rb index 6221163ac54..2812c5473e9 100644 --- a/features/steps/groups.rb +++ b/features/steps/groups.rb @@ -128,14 +128,14 @@ class Spinach::Features::Groups < Spinach::FeatureSteps end step 'I change group "Owned" avatar' do - attach_file(:group_avatar, File.join(Rails.root, 'public', 'gitlab_logo.png')) + attach_file(:group_avatar, File.join(Rails.root, 'spec', 'fixtures', 'banana_sample.gif')) click_button "Save group" Group.find_by(name: "Owned").reload end step 'I should see new group "Owned" avatar' do expect(Group.find_by(name: "Owned").avatar).to be_instance_of AvatarUploader - expect(Group.find_by(name: "Owned").avatar.url).to eq "/uploads/group/avatar/#{ Group.find_by(name:"Owned").id }/gitlab_logo.png" + expect(Group.find_by(name: "Owned").avatar.url).to eq "/uploads/group/avatar/#{ Group.find_by(name:"Owned").id }/banana_sample.gif" end step 'I should see the "Remove avatar" button' do @@ -143,7 +143,7 @@ class Spinach::Features::Groups < Spinach::FeatureSteps end step 'I have group "Owned" avatar' do - attach_file(:group_avatar, File.join(Rails.root, 'public', 'gitlab_logo.png')) + attach_file(:group_avatar, File.join(Rails.root, 'spec', 'fixtures', 'banana_sample.gif')) click_button "Save group" Group.find_by(name: "Owned").reload end diff --git a/features/steps/profile/profile.rb b/features/steps/profile/profile.rb index 3f19bed8a0b..11e1163c352 100644 --- a/features/steps/profile/profile.rb +++ b/features/steps/profile/profile.rb @@ -27,14 +27,14 @@ class Spinach::Features::Profile < Spinach::FeatureSteps end step 'I change my avatar' do - attach_file(:user_avatar, File.join(Rails.root, 'public', 'gitlab_logo.png')) + attach_file(:user_avatar, File.join(Rails.root, 'spec', 'fixtures', 'banana_sample.gif')) click_button "Save changes" @user.reload end step 'I should see new avatar' do expect(@user.avatar).to be_instance_of AvatarUploader - expect(@user.avatar.url).to eq "/uploads/user/avatar/#{ @user.id }/gitlab_logo.png" + expect(@user.avatar.url).to eq "/uploads/user/avatar/#{ @user.id }/banana_sample.gif" end step 'I should see the "Remove avatar" button' do @@ -42,7 +42,7 @@ class Spinach::Features::Profile < Spinach::FeatureSteps end step 'I have an avatar' do - attach_file(:user_avatar, File.join(Rails.root, 'public', 'gitlab_logo.png')) + attach_file(:user_avatar, File.join(Rails.root, 'spec', 'fixtures', 'banana_sample.gif')) click_button "Save changes" @user.reload end diff --git a/features/steps/project/project.rb b/features/steps/project/project.rb index e4465a1c3b7..b4a0ba1e27f 100644 --- a/features/steps/project/project.rb +++ b/features/steps/project/project.rb @@ -28,7 +28,7 @@ class Spinach::Features::Project < Spinach::FeatureSteps step 'I change the project avatar' do attach_file( :project_avatar, - File.join(Rails.root, 'public', 'gitlab_logo.png') + File.join(Rails.root, 'spec', 'fixtures', 'banana_sample.gif') ) click_button 'Save changes' @project.reload @@ -37,7 +37,7 @@ class Spinach::Features::Project < Spinach::FeatureSteps step 'I should see new project avatar' do expect(@project.avatar).to be_instance_of AvatarUploader url = @project.avatar.url - expect(url).to eq "/uploads/project/avatar/#{ @project.id }/gitlab_logo.png" + expect(url).to eq "/uploads/project/avatar/#{ @project.id }/banana_sample.gif" end step 'I should see the "Remove avatar" button' do @@ -47,7 +47,7 @@ class Spinach::Features::Project < Spinach::FeatureSteps step 'I have an project avatar' do attach_file( :project_avatar, - File.join(Rails.root, 'public', 'gitlab_logo.png') + File.join(Rails.root, 'spec', 'fixtures', 'banana_sample.gif') ) click_button 'Save changes' @project.reload diff --git a/spec/helpers/application_helper_spec.rb b/spec/helpers/application_helper_spec.rb index 582c401c55a..8fd3d8f407b 100644 --- a/spec/helpers/application_helper_spec.rb +++ b/spec/helpers/application_helper_spec.rb @@ -40,15 +40,15 @@ describe ApplicationHelper do end describe 'project_icon' do - avatar_file_path = File.join(Rails.root, 'public', 'gitlab_logo.png') + avatar_file_path = File.join(Rails.root, 'spec', 'fixtures', 'banana_sample.gif') it 'should return an url for the avatar' 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" + avatar_url = "http://localhost/uploads/project/avatar/#{ project.id }/banana_sample.gif" expect(project_icon("#{project.namespace.to_param}/#{project.to_param}").to_s).to eq( - "\"Gitlab" + "\"Banana" ) end @@ -65,14 +65,14 @@ describe ApplicationHelper do end describe 'avatar_icon' do - avatar_file_path = File.join(Rails.root, 'public', 'gitlab_logo.png') + avatar_file_path = File.join(Rails.root, 'spec', 'fixtures', 'banana_sample.gif') it 'should return an url for the avatar' do user = create(:user) user.avatar = File.open(avatar_file_path) user.save! expect(avatar_icon(user.email).to_s). - to match("/uploads/user/avatar/#{ user.id }/gitlab_logo.png") + to match("/uploads/user/avatar/#{ user.id }/banana_sample.gif") end it 'should return an url for the avatar with relative url' do @@ -83,7 +83,7 @@ describe ApplicationHelper do user.avatar = File.open(avatar_file_path) user.save! expect(avatar_icon(user.email).to_s). - to match("/gitlab/uploads/user/avatar/#{ user.id }/gitlab_logo.png") + to match("/gitlab/uploads/user/avatar/#{ user.id }/banana_sample.gif") end it 'should call gravatar_icon when no avatar is present' do diff --git a/spec/helpers/groups_helper.rb b/spec/helpers/groups_helper.rb index 3e99ab84ec9..5d174460681 100644 --- a/spec/helpers/groups_helper.rb +++ b/spec/helpers/groups_helper.rb @@ -2,14 +2,14 @@ require 'spec_helper' describe GroupsHelper do describe 'group_icon' do - avatar_file_path = File.join(Rails.root, 'public', 'gitlab_logo.png') + avatar_file_path = File.join(Rails.root, 'spec', 'fixtures', 'banana_sample.gif') it 'should return an url for the avatar' do group = create(:group) group.avatar = File.open(avatar_file_path) group.save! expect(group_icon(group.path).to_s). - to match("/uploads/group/avatar/#{ group.id }/gitlab_logo.png") + to match("/uploads/group/avatar/#{ group.id }/banana_sample.gif") end it 'should give default avatar_icon when no avatar is present' do