summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDouwe Maan <douwe@gitlab.com>2017-05-12 15:53:45 +0000
committerDouwe Maan <douwe@gitlab.com>2017-05-12 15:53:45 +0000
commitc23bc26335d30904bbe3094e587c3b170bdf1906 (patch)
tree7263c15ad81ed0440186971e24a29a3d7db9f0bf
parent75807f2ac9151847544594cb2bd12c73edeebe0a (diff)
parentce714d4172fe031949a1c51b61aa1bed97f7ba1f (diff)
downloadgitlab-ce-c23bc26335d30904bbe3094e587c3b170bdf1906.tar.gz
Merge branch 'fix-form_spec-failure-wait_for_ajax-unneeded-command' into 'master'
Fix form_spec.rb See merge request !11330
-rw-r--r--spec/features/issues/form_spec.rb18
1 files changed, 10 insertions, 8 deletions
diff --git a/spec/features/issues/form_spec.rb b/spec/features/issues/form_spec.rb
index 87adce3cddd..095cbb65c16 100644
--- a/spec/features/issues/form_spec.rb
+++ b/spec/features/issues/form_spec.rb
@@ -1,8 +1,9 @@
require 'rails_helper'
-describe 'New/edit issue', feature: true, js: true do
+describe 'New/edit issue', :feature, :js do
include GitlabRoutingHelper
include ActionView::Helpers::JavaScriptHelper
+ include WaitForAjax
let!(:project) { create(:project) }
let!(:user) { create(:user)}
@@ -26,6 +27,8 @@ describe 'New/edit issue', feature: true, js: true do
describe 'multiple assignees' do
before do
click_button 'Unassigned'
+
+ wait_for_ajax
end
it 'unselects other assignees when unassigned is selected' do
@@ -65,6 +68,9 @@ describe 'New/edit issue', feature: true, js: true do
expect(find('a', text: 'Assign to me')).to be_visible
click_button 'Unassigned'
+
+ wait_for_ajax
+
page.within '.dropdown-menu-user' do
click_link user2.name
end
@@ -148,16 +154,15 @@ describe 'New/edit issue', feature: true, js: true do
it 'correctly updates the selected user when changing assignee' do
click_button 'Unassigned'
+
+ wait_for_ajax
+
page.within '.dropdown-menu-user' do
click_link user.name
end
expect(find('input[name="issue[assignee_ids][]"]', visible: false).value).to match(user.id.to_s)
-
- click_button user.name
-
expect(find('.dropdown-menu-user a.is-active').first(:xpath, '..')['data-user-id']).to eq(user.id.to_s)
-
# check the ::before pseudo element to ensure checkmark icon is present
expect(before_for_selector('.dropdown-menu-selectable a.is-active')).not_to eq('')
expect(before_for_selector('.dropdown-menu-selectable a:not(.is-active)')).to eq('')
@@ -167,9 +172,6 @@ describe 'New/edit issue', feature: true, js: true do
end
expect(find('input[name="issue[assignee_ids][]"]', visible: false).value).to match(user2.id.to_s)
-
- click_button user2.name
-
expect(find('.dropdown-menu-user a.is-active').first(:xpath, '..')['data-user-id']).to eq(user2.id.to_s)
end
end