diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2022-01-24 03:12:40 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2022-01-24 03:12:40 +0300 |
commit | 10b5e85b507ca5377f0f93d8c8ec5d4d432ae291 (patch) | |
tree | f2c8bacd903d84462abc67f00a38d231abae63dd /spec | |
parent | 3c6803b07510a705508cf2529325b86eda460bf2 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec')
-rw-r--r-- | spec/features/projects/files/user_browses_files_spec.rb | 27 |
1 files changed, 16 insertions, 11 deletions
diff --git a/spec/features/projects/files/user_browses_files_spec.rb b/spec/features/projects/files/user_browses_files_spec.rb index 508dec70db6..c9d599e40b6 100644 --- a/spec/features/projects/files/user_browses_files_spec.rb +++ b/spec/features/projects/files/user_browses_files_spec.rb @@ -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 |