diff options
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 |