From 52cacdb89bb29f355e0c3a33c3250ac2d3fea036 Mon Sep 17 00:00:00 2001 From: GitLab Bot Date: Tue, 14 Apr 2020 03:09:39 +0000 Subject: Add latest changes from gitlab-org/gitlab@master --- spec/features/dashboard/projects_spec.rb | 12 +++++---- spec/features/ide/user_commits_changes_spec.rb | 33 +++++++++++++++++++++++ spec/features/projects/pipelines/pipeline_spec.rb | 11 ++------ 3 files changed, 42 insertions(+), 14 deletions(-) create mode 100644 spec/features/ide/user_commits_changes_spec.rb (limited to 'spec/features') diff --git a/spec/features/dashboard/projects_spec.rb b/spec/features/dashboard/projects_spec.rb index 73f759f8a54..218cbf871a9 100644 --- a/spec/features/dashboard/projects_spec.rb +++ b/spec/features/dashboard/projects_spec.rb @@ -244,13 +244,15 @@ describe 'Dashboard Projects' do ActiveRecord::QueryRecorder.new { visit dashboard_projects_path }.count - # There are three known N+1 queries: + # There are seven known N+1 queries: https://gitlab.com/gitlab-org/gitlab/-/issues/214037 # 1. Project#open_issues_count # 2. Project#open_merge_requests_count # 3. Project#forks_count - # - # In addition, ProjectsHelper#load_pipeline_status also adds an - # additional query. - expect { visit dashboard_projects_path }.not_to exceed_query_limit(control_count + 4) + # 4. ProjectsHelper#load_pipeline_status + # 5. RendersMemberAccess#preload_max_member_access_for_collection + # 6. User#max_member_access_for_project_ids + # 7. CommitWithPipeline#last_pipeline + + expect { visit dashboard_projects_path }.not_to exceed_query_limit(control_count + 7) end end diff --git a/spec/features/ide/user_commits_changes_spec.rb b/spec/features/ide/user_commits_changes_spec.rb new file mode 100644 index 00000000000..f53abde1523 --- /dev/null +++ b/spec/features/ide/user_commits_changes_spec.rb @@ -0,0 +1,33 @@ +# frozen_string_literal: true + +require 'spec_helper' + +describe 'IDE user commits changes', :js do + include WebIdeSpecHelpers + + let(:project) { create(:project, :public, :repository) } + let(:user) { project.owner } + + before do + sign_in(user) + + ide_visit(project) + end + + it 'user updates nested files' do + content = <<~HEREDOC + Lorem ipsum + Dolar sit + Amit + HEREDOC + + ide_create_new_file('foo/bar/lorem_ipsum.md', content: content) + ide_delete_file('foo/bar/.gitkeep') + + ide_commit + + expect(page).to have_content('All changes are committed') + expect(project.repository.blob_at('master', 'foo/bar/.gitkeep')).to be_nil + expect(project.repository.blob_at('master', 'foo/bar/lorem_ipsum.md').data).to eql(content) + end +end diff --git a/spec/features/projects/pipelines/pipeline_spec.rb b/spec/features/projects/pipelines/pipeline_spec.rb index 561c0552007..e8846b5b617 100644 --- a/spec/features/projects/pipelines/pipeline_spec.rb +++ b/spec/features/projects/pipelines/pipeline_spec.rb @@ -133,15 +133,8 @@ describe 'Pipeline', :js do context 'when there are two related merge requests' do before do - create(:merge_request, - source_project: project, - source_branch: pipeline.ref, - target_branch: 'feature-1') - - create(:merge_request, - source_project: project, - source_branch: pipeline.ref, - target_branch: 'feature-2') + create(:merge_request, source_project: project, source_branch: pipeline.ref) + create(:merge_request, source_project: project, source_branch: pipeline.ref, target_branch: 'fix') end it 'links to the most recent related merge request' do -- cgit v1.2.1