summaryrefslogtreecommitdiff
path: root/spec/features/projects/artifacts/file_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/features/projects/artifacts/file_spec.rb')
-rw-r--r--spec/features/projects/artifacts/file_spec.rb24
1 files changed, 21 insertions, 3 deletions
diff --git a/spec/features/projects/artifacts/file_spec.rb b/spec/features/projects/artifacts/file_spec.rb
index 74308a7e8dd..25c4f3c87a2 100644
--- a/spec/features/projects/artifacts/file_spec.rb
+++ b/spec/features/projects/artifacts/file_spec.rb
@@ -6,14 +6,18 @@ feature 'Artifact file', :js, feature: true do
let(:build) { create(:ci_build, :artifacts, pipeline: pipeline) }
def visit_file(path)
- visit file_namespace_project_build_artifacts_path(project.namespace, project, build, path)
+ visit file_path(path)
+ end
+
+ def file_path(path)
+ file_namespace_project_job_artifacts_path(project.namespace, project, build, path)
end
context 'Text file' do
before do
visit_file('other_artifacts_0.1.2/doc_sample.txt')
- wait_for_ajax
+ wait_for_requests
end
it 'displays an error' do
@@ -37,7 +41,7 @@ feature 'Artifact file', :js, feature: true do
before do
visit_file('rails_sample.jpg')
- wait_for_ajax
+ wait_for_requests
end
it 'displays the blob' do
@@ -56,4 +60,18 @@ feature 'Artifact file', :js, feature: true do
end
end
end
+
+ context 'when visiting old URL' do
+ let(:file_url) do
+ file_path('other_artifacts_0.1.2/doc_sample.txt')
+ end
+
+ before do
+ visit file_url.sub('/-/jobs', '/builds')
+ end
+
+ it "redirects to new URL" do
+ expect(page.current_path).to eq(file_url)
+ end
+ end
end