diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-03-12 15:09:39 +0000 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-03-12 15:09:39 +0000 |
commit | dc889678d1de8c09310b2f8f9742bb6c78a6f1a4 (patch) | |
tree | 70945aa6721a271fc8057efa13c3216a03fbac45 /spec/features/projects/releases | |
parent | cd52759ee33051b8ad7b88b02ba7954e4fad7018 (diff) | |
download | gitlab-ce-dc889678d1de8c09310b2f8f9742bb6c78a6f1a4.tar.gz |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/features/projects/releases')
-rw-r--r-- | spec/features/projects/releases/user_views_releases_spec.rb | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/spec/features/projects/releases/user_views_releases_spec.rb b/spec/features/projects/releases/user_views_releases_spec.rb index 4507d90576b..a4ba81ffeb9 100644 --- a/spec/features/projects/releases/user_views_releases_spec.rb +++ b/spec/features/projects/releases/user_views_releases_spec.rb @@ -24,16 +24,31 @@ describe 'User views releases', :js do context 'when there is a link as an asset' do let!(:release_link) { create(:release_link, release: release, url: url ) } let(:url) { "#{project.web_url}/-/jobs/1/artifacts/download" } + let(:direct_asset_link) { Gitlab::Routing.url_helpers.project_release_url(project, release) << release_link.filepath } it 'sees the link' do visit project_releases_path(project) page.within('.js-assets-list') do - expect(page).to have_link release_link.name, href: release_link.url + expect(page).to have_link release_link.name, href: direct_asset_link expect(page).not_to have_content('(external source)') end end + context 'when there is a link redirect' do + let!(:release_link) { create(:release_link, release: release, name: 'linux-amd64 binaries', filepath: '/binaries/linux-amd64', url: url) } + let(:url) { "#{project.web_url}/-/jobs/1/artifacts/download" } + + it 'sees the link' do + visit project_releases_path(project) + + page.within('.js-assets-list') do + expect(page).to have_link release_link.name, href: direct_asset_link + expect(page).not_to have_content('(external source)') + end + end + end + context 'when url points to external resource' do let(:url) { 'http://google.com/download' } |