diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-11-17 14:33:21 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-11-17 14:33:21 +0300 |
commit | 7021455bd1ed7b125c55eb1b33c5a01f2bc55ee0 (patch) | |
tree | 5bdc2229f5198d516781f8d24eace62fc7e589e9 /spec/tasks/gitlab/update_templates_rake_spec.rb | |
parent | 185b095e93520f96e9cfc31d9c3e69b498cdab7c (diff) |
Add latest changes from gitlab-org/gitlab@15-6-stable-eev15.6.0-rc42
Diffstat (limited to 'spec/tasks/gitlab/update_templates_rake_spec.rb')
-rw-r--r-- | spec/tasks/gitlab/update_templates_rake_spec.rb | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/spec/tasks/gitlab/update_templates_rake_spec.rb b/spec/tasks/gitlab/update_templates_rake_spec.rb index 7eccdf22a1f..85da490f718 100644 --- a/spec/tasks/gitlab/update_templates_rake_spec.rb +++ b/spec/tasks/gitlab/update_templates_rake_spec.rb @@ -4,6 +4,7 @@ require 'rake_helper' RSpec.describe 'gitlab:update_project_templates rake task', :silence_stdout do let!(:tmpdir) { Dir.mktmpdir } + let(:template) { Gitlab::ProjectTemplate.find(:rails) } before do Rake.application.rake_require 'tasks/gitlab/update_templates' @@ -14,7 +15,7 @@ RSpec.describe 'gitlab:update_project_templates rake task', :silence_stdout do .and_return(Pathname.new(tmpdir)) # Gitlab::HTTP resolves the domain to an IP prior to WebMock taking effect, hence the wildcard - stub_request(:get, %r{^https://.*/api/v4/projects/gitlab-org%2Fproject-templates%2Frails/repository/commits\?page=1&per_page=1}) + stub_request(:get, %r{^https://.*/api/v4/projects/#{template.uri_encoded_project_path}/repository/commits\?page=1&per_page=1}) .to_return( status: 200, body: [{ id: '67812735b83cb42710f22dc98d73d42c8bf4d907' }].to_json, @@ -27,8 +28,8 @@ RSpec.describe 'gitlab:update_project_templates rake task', :silence_stdout do end it 'updates valid project templates' do - expect { run_rake_task('gitlab:update_project_templates', ['rails']) } + expect { run_rake_task('gitlab:update_project_templates', [template.name]) } .to change { Dir.entries(tmpdir) } - .by(['rails.tar.gz']) + .by(["#{template.name}.tar.gz"]) end end |