summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDouwe Maan <douwe@gitlab.com>2016-10-28 11:13:20 +0000
committerDouwe Maan <douwe@gitlab.com>2016-10-28 11:13:20 +0000
commit8b0cdf4c832ca5f40a6c24207021ed122984b280 (patch)
tree4ce4dd8244dac93c882212109730c4bcaf16f624
parent66870960af8d8a4cafec4abc529bd073d23fd1e4 (diff)
parent671556c6117b5a269cc40b53751b1abc8e966ade (diff)
downloadgitlab-ce-8b0cdf4c832ca5f40a6c24207021ed122984b280.tar.gz
Merge branch '23875-fixup-failing-spec' into 'master'
Prevent a spec from failing in `spec/features/merge_requests/diff_notes_resolve_spec.rb` ## What does this MR do? Fixes a failing spec in `spec/features/merge_requests/diff_notes_resolve_spec.rb` ## Are there points in the code the reviewer needs to double check? ## Why was this MR needed? Tests failing on master. RSpec executes inner `before` blocks after outer `before` blocks, so the second note was being added *after* loading the page, and then being pulled in by running JS on the page, causing intermittent failures if we clicked the resolve button before the note was loaded. ## Screenshots (if relevant) ## Does this MR meet the acceptance criteria? - [ ] [CHANGELOG](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CHANGELOG.md) entry added - [ ] [Documentation created/updated](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/doc/development/doc_styleguide.md) - [ ] API support added - Tests - [ ] Added for this feature/bug - [ ] All builds are passing - [ ] Conform by the [merge request performance guides](http://docs.gitlab.com/ce/development/merge_request_performance_guidelines.html) - [ ] Conform by the [style guides](https://gitlab.com/gitlab-org/gitlab-ce/blob/master/CONTRIBUTING.md#style-guides) - [ ] Branch has no merge conflicts with `master` (if it does - rebase it please) - [ ] [Squashed related commits together](https://git-scm.com/book/en/Git-Tools-Rewriting-History#Squashing-Commits) ## What are the relevant issue numbers? Closes #23875 See merge request !7150
-rw-r--r--spec/features/merge_requests/diff_notes_resolve_spec.rb10
1 files changed, 6 insertions, 4 deletions
diff --git a/spec/features/merge_requests/diff_notes_resolve_spec.rb b/spec/features/merge_requests/diff_notes_resolve_spec.rb
index c6adf7e4c56..5e6d8467217 100644
--- a/spec/features/merge_requests/diff_notes_resolve_spec.rb
+++ b/spec/features/merge_requests/diff_notes_resolve_spec.rb
@@ -194,12 +194,12 @@ feature 'Diff notes resolve', feature: true, js: true do
context 'multiple notes' do
before do
create(:diff_note_on_merge_request, project: project, noteable: merge_request)
+ visit_merge_request
end
it 'does not mark discussion as resolved when resolving single note' do
- page.within '.diff-content .note' do
+ page.first '.diff-content .note' do
first('.line-resolve-btn').click
- sleep 1
expect(first('.line-resolve-btn')['data-original-title']).to eq("Resolved by #{user.name}")
end
@@ -212,7 +212,9 @@ feature 'Diff notes resolve', feature: true, js: true do
it 'resolves discussion' do
page.all('.note').each do |note|
- note.find('.line-resolve-btn').click
+ note.all('.line-resolve-btn').each do |button|
+ button.click
+ end
end
expect(page).to have_content('Resolved by')
@@ -292,7 +294,7 @@ feature 'Diff notes resolve', feature: true, js: true do
expect(holder).to have_selector('.discussion-next-btn')
end
end
-
+
it 'displays next discussion even if hidden' do
page.all('.note-discussion').each do |discussion|
page.within discussion do