fix static_analysis (rubocop)

This commit is contained in:
Jarka Kadlecova 2017-08-14 07:15:52 +02:00
parent 240d262db3
commit b67e333ce8
3 changed files with 5 additions and 7 deletions

View File

@ -889,8 +889,7 @@ describe Projects::IssuesController do
it 'returns discussion json' do it 'returns discussion json' do
get :discussions, namespace_id: project.namespace, project_id: project, id: issue.iid get :discussions, namespace_id: project.namespace, project_id: project, id: issue.iid
expect(JSON.parse(response.body).first.keys).to match_array( expect(JSON.parse(response.body).first.keys).to match_array(%w[id reply_id expanded notes individual_note])
['id', 'reply_id', 'expanded', 'notes', 'individual_note'])
end end
end end
end end

View File

@ -50,7 +50,6 @@ feature 'Issue notes polling', :js do
expect(page).to have_selector(".alert") expect(page).to have_selector(".alert")
end end
it 'when editing but you changed some things, an update comes in, and you press cancel, show the updated content' do 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) click_edit_action(existing_note)

View File

@ -76,15 +76,14 @@ shared_examples 'discussion comments' do |resource_name|
expect(page).not_to have_selector menu_selector expect(page).not_to have_selector menu_selector
end end
it 'clicking the ul padding or divider should not change the text' do it 'clicking the ul padding or divider should not change the text' do
find(menu_selector).trigger 'click'
if resource_name == 'issue' if resource_name == 'issue'
find(menu_selector).trigger 'click'
expect(find(dropdown_selector)).to have_content 'Comment' expect(find(dropdown_selector)).to have_content 'Comment'
find(toggle_selector).click find(toggle_selector).click
find("#{menu_selector} .divider").trigger 'click' find("#{menu_selector} .divider").trigger 'click'
expect(find(dropdown_selector)).to have_content 'Comment'
else else
find(menu_selector).trigger 'click' find(menu_selector).trigger 'click'
@ -94,8 +93,9 @@ shared_examples 'discussion comments' do |resource_name|
find("#{menu_selector} .divider").trigger 'click' find("#{menu_selector} .divider").trigger 'click'
expect(page).to have_selector menu_selector expect(page).to have_selector menu_selector
expect(find(dropdown_selector)).to have_content 'Comment'
end end
expect(find(dropdown_selector)).to have_content 'Comment'
end end
describe 'when selecting "Start discussion"' do describe 'when selecting "Start discussion"' do