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 @@
require "spec_helper"
RSpec.describe "User browses files" do
RSpec.describe "User browses files", :js do
include RepoHelpers
let(:fork_message) do
......@@ -340,32 +340,37 @@ RSpec.describe "User browses files" do
let(:newrev) { project.repository.commit('master').sha }
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')
path = File.join('master', filename)
visit(project_blob_path(project, path))
wait_for_requests
end
it "shows a raw file content" do
click_link("Open raw")
it "shows raw file content in a new tab" do
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
context "when browsing a raw file" do
before do
stub_feature_flags(refactor_blob_viewer: false) # This stub will be removed in https://gitlab.com/gitlab-org/gitlab/-/issues/350456
path = File.join(RepoHelpers.sample_commit.id, RepoHelpers.sample_blob.path)
visit(tree_path_root_ref)
wait_for_requests
visit(project_blob_path(project, path))
click_link(".gitignore")
wait_for_requests
end
it "shows a raw file content" do
click_link("Open raw")
it "shows raw file content in a new tab" do
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
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