Commit 38205f79 authored by Jacques's avatar Jacques

Fix file browser rspecs

Fixed the rspecs with the blob refactor FF enabled
parent 15991b84
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
require "spec_helper" require "spec_helper"
RSpec.describe "User browses files" do RSpec.describe "User browses files", :js do
include RepoHelpers include RepoHelpers
let(:fork_message) do let(:fork_message) do
...@@ -340,32 +340,37 @@ RSpec.describe "User browses files" do ...@@ -340,32 +340,37 @@ RSpec.describe "User browses files" do
let(:newrev) { project.repository.commit('master').sha } let(:newrev) { project.repository.commit('master').sha }
before do before do
stub_feature_flags(refactor_blob_viewer: false) # This stub will be removed in https://gitlab.com/gitlab-org/gitlab/-/issues/350456
create_file_in_repo(project, 'master', 'master', filename, 'Test file') create_file_in_repo(project, 'master', 'master', filename, 'Test file')
path = File.join('master', filename) path = File.join('master', filename)
visit(project_blob_path(project, path)) visit(project_blob_path(project, path))
wait_for_requests
end end
it "shows a raw file content" do it "shows raw file content in a new tab" do
click_link("Open raw") new_tab = window_opened_by {click_link 'Open raw'}
expect(source).to eq("") # Body is filled in by gitlab-workhorse within_window new_tab do
expect(page).to have_content("Test file")
end
end end
end end
context "when browsing a raw file" do context "when browsing a raw file" do
before do before do
stub_feature_flags(refactor_blob_viewer: false) # This stub will be removed in https://gitlab.com/gitlab-org/gitlab/-/issues/350456 visit(tree_path_root_ref)
path = File.join(RepoHelpers.sample_commit.id, RepoHelpers.sample_blob.path) wait_for_requests
visit(project_blob_path(project, path)) click_link(".gitignore")
wait_for_requests
end end
it "shows a raw file content" do it "shows raw file content in a new tab" do
click_link("Open raw") new_tab = window_opened_by {click_link 'Open raw'}
expect(source).to eq("") # Body is filled in by gitlab-workhorse within_window new_tab do
expect(page).to have_content("*.rbc")
end
end end
end end
end end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment