summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorJarka Kadlecova <jarka@gitlab.com>2017-08-14 07:15:52 +0200
committerJarka Kadlecova <jarka@gitlab.com>2017-08-14 07:15:52 +0200
commitb67e333ce8dbb7bb81959c293e3e9c4aef5e9702 (patch)
tree2eef231f4dac6eedf23f50b03ba32280475c3d88 /spec
parent240d262db3ab073a6ce75acc4f365e48530146a8 (diff)
downloadgitlab-ce-b67e333ce8dbb7bb81959c293e3e9c4aef5e9702.tar.gz
fix static_analysis (rubocop)
Diffstat (limited to 'spec')
-rw-r--r--spec/controllers/projects/issues_controller_spec.rb3
-rw-r--r--spec/features/issues/note_polling_spec.rb1
-rw-r--r--spec/support/features/discussion_comments_shared_example.rb8
3 files changed, 5 insertions, 7 deletions
diff --git a/spec/controllers/projects/issues_controller_spec.rb b/spec/controllers/projects/issues_controller_spec.rb
index c07c035fcda..66d6a51578e 100644
--- a/spec/controllers/projects/issues_controller_spec.rb
+++ b/spec/controllers/projects/issues_controller_spec.rb
@@ -889,8 +889,7 @@ describe Projects::IssuesController do
it 'returns discussion json' do
get :discussions, namespace_id: project.namespace, project_id: project, id: issue.iid
- expect(JSON.parse(response.body).first.keys).to match_array(
- ['id', 'reply_id', 'expanded', 'notes', 'individual_note'])
+ expect(JSON.parse(response.body).first.keys).to match_array(%w[id reply_id expanded notes individual_note])
end
end
end
diff --git a/spec/features/issues/note_polling_spec.rb b/spec/features/issues/note_polling_spec.rb
index 2503aecdc23..9145ebb385a 100644
--- a/spec/features/issues/note_polling_spec.rb
+++ b/spec/features/issues/note_polling_spec.rb
@@ -50,7 +50,6 @@ feature 'Issue notes polling', :js do
expect(page).to have_selector(".alert")
end
-
it 'when editing but you changed some things, an update comes in, and you press cancel, show the updated content' do
click_edit_action(existing_note)
diff --git a/spec/support/features/discussion_comments_shared_example.rb b/spec/support/features/discussion_comments_shared_example.rb
index b5004a5beba..81cb94ab8c4 100644
--- a/spec/support/features/discussion_comments_shared_example.rb
+++ b/spec/support/features/discussion_comments_shared_example.rb
@@ -76,15 +76,14 @@ shared_examples 'discussion comments' do |resource_name|
expect(page).not_to have_selector menu_selector
end
-
it 'clicking the ul padding or divider should not change the text' do
+ find(menu_selector).trigger 'click'
+
if resource_name == 'issue'
- find(menu_selector).trigger 'click'
expect(find(dropdown_selector)).to have_content 'Comment'
find(toggle_selector).click
find("#{menu_selector} .divider").trigger 'click'
- expect(find(dropdown_selector)).to have_content 'Comment'
else
find(menu_selector).trigger 'click'
@@ -94,8 +93,9 @@ shared_examples 'discussion comments' do |resource_name|
find("#{menu_selector} .divider").trigger 'click'
expect(page).to have_selector menu_selector
- expect(find(dropdown_selector)).to have_content 'Comment'
end
+
+ expect(find(dropdown_selector)).to have_content 'Comment'
end
describe 'when selecting "Start discussion"' do