Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorJacob Schatz <jschatz@gitlab.com>2016-08-19 17:48:06 +0300
committerJacob Schatz <jschatz@gitlab.com>2016-08-19 17:48:06 +0300
commit39820d8013aa550470180ac609ad70c40098d035 (patch)
tree8be034f05b9d6aaaa4dc0c23ce0a86137da6f339 /spec
parente5840a4d9b6d696f26cd1956c5aace2507f3abf0 (diff)
parent9a8b29e3ee3fc88f536f104a4ff962c0e435f3f4 (diff)
Merge branch 'cs-async-branch-dropdown' into 'master'
Load branch dropdowns asynchronously for cherry pick and revert dialogs ## Why was this MR needed and what does it do? Previously every commit page was loading every branch onto the page twice, once each for the Cherry Pick and Revert modal dialogs. Most of the time they're never used, so that's a bit of a waste. This loads them asynchronously by modifying the existing ref switcher code to also work for the branch selectors. This is better for performance. ## Are there points in the code the reviewer needs to double check? Make sure Cherry Picking and Reverting still work (from my tests they seem to be fine). ## What are the relevant issue numbers? Fixes #20108. ## Screenshots (if relevant) Before: ![Screen_Shot_2016-08-01_at_4.35.21_PM](/uploads/6b76ea656fd00df52ab56df5309976dc/Screen_Shot_2016-08-01_at_4.35.21_PM.png) ![Screen_Shot_2016-08-01_at_4.35.52_PM](/uploads/d2699a4bfc4ad1a4d414429e7c50e60f/Screen_Shot_2016-08-01_at_4.35.52_PM.png) After: ![Screen_Shot_2016-08-01_at_4.32.49_PM](/uploads/5faa6494b10dd9ac5e8850763a0c4018/Screen_Shot_2016-08-01_at_4.32.49_PM.png) ![Screen_Shot_2016-08-01_at_4.32.56_PM](/uploads/87c490bb375244e7d72421fd55e13e3f/Screen_Shot_2016-08-01_at_4.32.56_PM.png) ![Screen_Shot_2016-08-01_at_4.33.02_PM](/uploads/59ae65c0afc39d8939a9f36431815854/Screen_Shot_2016-08-01_at_4.33.02_PM.png) ## Does this MR meet the acceptance criteria? - [x] [CHANGELOG](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CHANGELOG) entry added - [ ] [Documentation created/updated](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/doc/development/doc_styleguide.md) - [ ] API support added - Tests - [x] Added for this feature/bug - [x] All builds are passing - [x] Conform by the [style guides](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CONTRIBUTING.md#style-guides) - [x] Branch has no merge conflicts with `master` (if you do - rebase it please) - [x] [Squashed related commits together](https://git-scm.com/book/en/Git-Tools-Rewriting-History#Squashing-Commits) cc: @iamphill @jschatz1 See merge request !5607
Diffstat (limited to 'spec')
-rw-r--r--spec/features/projects/branches_spec.rb2
-rw-r--r--spec/features/projects/commits/cherry_pick_spec.rb31
2 files changed, 27 insertions, 6 deletions
diff --git a/spec/features/projects/branches_spec.rb b/spec/features/projects/branches_spec.rb
index 79abba21854..1b14945bf0a 100644
--- a/spec/features/projects/branches_spec.rb
+++ b/spec/features/projects/branches_spec.rb
@@ -20,7 +20,7 @@ describe 'Branches', feature: true do
describe 'Find branches' do
it 'shows filtered branches', js: true do
- visit namespace_project_branches_path(project.namespace, project, project.id)
+ visit namespace_project_branches_path(project.namespace, project)
fill_in 'branch-search', with: 'fix'
find('#branch-search').native.send_keys(:enter)
diff --git a/spec/features/projects/commits/cherry_pick_spec.rb b/spec/features/projects/commits/cherry_pick_spec.rb
index 1b4ff6b6f1b..e45e3a36d01 100644
--- a/spec/features/projects/commits/cherry_pick_spec.rb
+++ b/spec/features/projects/commits/cherry_pick_spec.rb
@@ -1,4 +1,5 @@
require 'spec_helper'
+include WaitForAjax
describe 'Cherry-pick Commits' do
let(:project) { create(:project) }
@@ -8,12 +9,11 @@ describe 'Cherry-pick Commits' do
before do
login_as :user
project.team << [@user, :master]
- visit namespace_project_commits_path(project.namespace, project, project.repository.root_ref, { limit: 5 })
+ visit namespace_project_commit_path(project.namespace, project, master_pickable_commit.id)
end
context "I cherry-pick a commit" do
it do
- visit namespace_project_commit_path(project.namespace, project, master_pickable_commit.id)
find("a[href='#modal-cherry-pick-commit']").click
expect(page).not_to have_content('v1.0.0') # Only branches, not tags
page.within('#modal-cherry-pick-commit') do
@@ -26,7 +26,6 @@ describe 'Cherry-pick Commits' do
context "I cherry-pick a merge commit" do
it do
- visit namespace_project_commit_path(project.namespace, project, master_pickable_merge.id)
find("a[href='#modal-cherry-pick-commit']").click
page.within('#modal-cherry-pick-commit') do
uncheck 'create_merge_request'
@@ -38,7 +37,6 @@ describe 'Cherry-pick Commits' do
context "I cherry-pick a commit that was previously cherry-picked" do
it do
- visit namespace_project_commit_path(project.namespace, project, master_pickable_commit.id)
find("a[href='#modal-cherry-pick-commit']").click
page.within('#modal-cherry-pick-commit') do
uncheck 'create_merge_request'
@@ -56,7 +54,6 @@ describe 'Cherry-pick Commits' do
context "I cherry-pick a commit in a new merge request" do
it do
- visit namespace_project_commit_path(project.namespace, project, master_pickable_commit.id)
find("a[href='#modal-cherry-pick-commit']").click
page.within('#modal-cherry-pick-commit') do
click_button 'Cherry-pick'
@@ -64,4 +61,28 @@ describe 'Cherry-pick Commits' do
expect(page).to have_content('The commit has been successfully cherry-picked. You can now submit a merge request to get this change into the original branch.')
end
end
+
+ context "I cherry-pick a commit from a different branch", js: true do
+ it do
+ find('.commit-action-buttons a.dropdown-toggle').click
+ find(:css, "a[href='#modal-cherry-pick-commit']").click
+
+ page.within('#modal-cherry-pick-commit') do
+ click_button 'master'
+ end
+
+ wait_for_ajax
+
+ page.within('#modal-cherry-pick-commit .dropdown-menu .dropdown-content') do
+ click_link 'feature'
+ end
+
+ page.within('#modal-cherry-pick-commit') do
+ uncheck 'create_merge_request'
+ click_button 'Cherry-pick'
+ end
+
+ expect(page).to have_content('The commit has been successfully cherry-picked.')
+ end
+ end
end