diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2023-06-20 13:43:29 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2023-06-20 13:43:29 +0300 |
commit | 3b1af5cc7ed2666ff18b718ce5d30fa5a2756674 (patch) | |
tree | 3bc4a40e0ee51ec27eabf917c537033c0c5b14d4 /spec/requests/api/releases_spec.rb | |
parent | 9bba14be3f2c211bf79e15769cd9b77bc73a13bc (diff) |
Add latest changes from gitlab-org/gitlab@16-1-stable-eev16.1.0-rc42
Diffstat (limited to 'spec/requests/api/releases_spec.rb')
-rw-r--r-- | spec/requests/api/releases_spec.rb | 32 |
1 files changed, 19 insertions, 13 deletions
diff --git a/spec/requests/api/releases_spec.rb b/spec/requests/api/releases_spec.rb index 0b5cc3611bd..a018b91019b 100644 --- a/spec/requests/api/releases_spec.rb +++ b/spec/requests/api/releases_spec.rb @@ -791,16 +791,16 @@ RSpec.describe API::Releases, :aggregate_failures, feature_category: :release_or name: 'New release', tag_name: 'v0.1', description: 'Super nice release', - assets: { - links: [ - { - name: 'An example runbook link', - url: 'https://example.com/runbook', - link_type: 'runbook', - filepath: '/permanent/path/to/runbook' - } - ] - } + assets: { links: [link_asset] } + } + end + + let(:link_asset) do + { + name: 'An example runbook link', + url: 'https://example.com/runbook', + link_type: 'runbook', + filepath: '/permanent/path/to/runbook' } end @@ -906,8 +906,13 @@ RSpec.describe API::Releases, :aggregate_failures, feature_category: :release_or end context 'when using `direct_asset_path` for the asset link' do - before do - params[:direct_asset_path] = params.delete(:filepath) + let(:link_asset) do + { + name: 'An example runbook link', + url: 'https://example.com/runbook', + link_type: 'runbook', + direct_asset_path: '/permanent/path/to/runbook' + } end it 'creates a new release successfully' do @@ -915,8 +920,9 @@ RSpec.describe API::Releases, :aggregate_failures, feature_category: :release_or post api("/projects/#{project.id}/releases", maintainer), params: params end.to change { Release.count }.by(1) - release = project.releases.last + expect(response).to have_gitlab_http_status(:created) + release = project.releases.last expect(release.links.last.filepath).to eq('/permanent/path/to/runbook') end end |