diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-06-27 00:08:51 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-06-27 00:08:51 +0300 |
commit | 757d2fda7e2936b071a4cb600046ca375051d7c5 (patch) | |
tree | 76673008cb2e31c1df8705d0388fd3cabdd79d2d /spec/features | |
parent | ebe92e84a92d7d00710a6c5017ef2bb160268471 (diff) |
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'spec/features')
-rw-r--r-- | spec/features/projects/commits/user_browses_commits_spec.rb | 27 | ||||
-rw-r--r-- | spec/features/projects/files/user_browses_files_spec.rb | 2 | ||||
-rw-r--r-- | spec/features/projects/tree/tree_show_spec.rb | 10 |
3 files changed, 35 insertions, 4 deletions
diff --git a/spec/features/projects/commits/user_browses_commits_spec.rb b/spec/features/projects/commits/user_browses_commits_spec.rb index 2796156bfbf..dee964005a4 100644 --- a/spec/features/projects/commits/user_browses_commits_spec.rb +++ b/spec/features/projects/commits/user_browses_commits_spec.rb @@ -137,6 +137,33 @@ RSpec.describe 'User browses commits' do .and have_selector('entry summary', text: commit.description[0..10].delete("\r\n")) end + context "when commit has a filename with pathspec characters" do + let(:path) { ':wq' } + let(:filename) { File.join(path, 'test.txt') } + let(:ref) { project.repository.root_ref } + let(:newrev) { project.repository.commit('master').sha } + let(:short_newrev) { project.repository.commit('master').short_id } + let(:message) { 'Glob characters'} + + before do + create_file_in_repo(project, ref, ref, filename, 'Test file', commit_message: message) + visit project_commits_path(project, "#{ref}/#{path}", limit: 1) + wait_for_requests + end + + it 'searches commit', :js do + expect(page).to have_content(message) + + fill_in 'commits-search', with: 'bogus12345' + + expect(page).to have_content "Your search didn't match any commits" + + fill_in 'commits-search', with: 'Glob' + + expect(page).to have_content message + end + end + context 'when a commit links to a confidential issue' do let(:confidential_issue) { create(:issue, confidential: true, title: 'Secret issue!', project: project) } diff --git a/spec/features/projects/files/user_browses_files_spec.rb b/spec/features/projects/files/user_browses_files_spec.rb index 968cfbd17b9..e5259bd88be 100644 --- a/spec/features/projects/files/user_browses_files_spec.rb +++ b/spec/features/projects/files/user_browses_files_spec.rb @@ -341,7 +341,7 @@ RSpec.describe "User browses files" do end end - context "when browsing a file with glob characters" do + context "when browsing a file with pathspec characters" do let(:filename) { ':wq' } let(:newrev) { project.repository.commit('master').sha } diff --git a/spec/features/projects/tree/tree_show_spec.rb b/spec/features/projects/tree/tree_show_spec.rb index 7e2a41ad6e6..bd2af66710a 100644 --- a/spec/features/projects/tree/tree_show_spec.rb +++ b/spec/features/projects/tree/tree_show_spec.rb @@ -49,10 +49,11 @@ RSpec.describe 'Projects tree', :js do expect(page).not_to have_selector('.flash-alert') end - context "with a tree that contains glob characters" do + context "with a tree that contains pathspec characters" do let(:path) { ':wq' } let(:filename) { File.join(path, 'test.txt') } let(:newrev) { project.repository.commit('master').sha } + let(:short_newrev) { project.repository.commit('master').short_id } let(:message) { 'Glob characters'} before do @@ -61,11 +62,14 @@ RSpec.describe 'Projects tree', :js do wait_for_requests end - # Disabled until https://gitlab.com/gitlab-org/gitaly/-/issues/2888 is resolved - xit "renders tree table without errors" do + it "renders tree table without errors" do expect(page).to have_selector('.tree-item') expect(page).to have_content('test.txt') expect(page).to have_content(message) + + # Check last commit + expect(find('.commit-content').text).to include(message) + expect(find('.commit-sha-group').text).to eq(short_newrev) end end |