2017-05-18 12:57:37 -04:00
|
|
|
require 'spec_helper'
|
|
|
|
|
|
|
|
feature 'Browse artifact', :js, feature: true do
|
|
|
|
let(:project) { create(:project, :public) }
|
|
|
|
let(:pipeline) { create(:ci_empty_pipeline, project: project, sha: project.commit.sha, ref: 'master') }
|
|
|
|
let(:job) { create(:ci_build, :artifacts, pipeline: pipeline) }
|
|
|
|
|
|
|
|
def browse_path(path)
|
2017-07-06 12:20:50 -04:00
|
|
|
browse_project_job_artifacts_path(project, job, path)
|
2017-05-18 12:57:37 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
context 'when visiting old URL' do
|
|
|
|
let(:browse_url) do
|
|
|
|
browse_path('other_artifacts_0.1.2')
|
|
|
|
end
|
|
|
|
|
|
|
|
before do
|
2017-05-26 09:55:29 -04:00
|
|
|
visit browse_url.sub('/-/jobs', '/builds')
|
2017-05-18 12:57:37 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
it "redirects to new URL" do
|
|
|
|
expect(page.current_path).to eq(browse_url)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|