require'spec_helper'shared_examples'reportable note'doincludeNotesHelperlet(:comment){find("##{ActionView::RecordIdentifier.dom_id(note)}")}let(:more_actions_selector){'.more-actions.dropdown'}let(:abuse_report_path){new_abuse_report_path(user_id: note.author.id,ref_url: noteable_note_url(note))}it'has a `More actions` dropdown'doexpect(comment).tohave_selector(more_actions_selector)endit'dropdown has Edit, Report and Delete links'dodropdown=comment.find(more_actions_selector)dropdown.clickdropdown.find('.dropdown-menu li',match: :first)expect(dropdown).tohave_button('Edit comment')expect(dropdown).tohave_link('Report as abuse',href: abuse_report_path)expect(dropdown).tohave_link('Delete comment',href: note_url(note,project))endit'Report button links to a report page'dodropdown=comment.find(more_actions_selector)dropdown.clickdropdown.find('.dropdown-menu li',match: :first)dropdown.click_link('Report as abuse')expect(find('#user_name')['value']).tomatch(note.author.username)expect(find('#abuse_report_message')['value']).tomatch(noteable_note_url(note))endend