From 3e66795ef1ff1228906239763910b051d8afcc37 Mon Sep 17 00:00:00 2001 From: Felipe Artur Date: Thu, 21 Jun 2018 12:22:40 +0000 Subject: Changes tab VUE refactoring --- .../issuables/markdown_references/jira_spec.rb | 2 +- spec/features/issuables/shortcuts_issuable_spec.rb | 23 +++++++++++----------- 2 files changed, 12 insertions(+), 13 deletions(-) (limited to 'spec/features/issuables') diff --git a/spec/features/issuables/markdown_references/jira_spec.rb b/spec/features/issuables/markdown_references/jira_spec.rb index fa0ab88624e..8eaccfc0949 100644 --- a/spec/features/issuables/markdown_references/jira_spec.rb +++ b/spec/features/issuables/markdown_references/jira_spec.rb @@ -163,7 +163,7 @@ describe "Jira", :js do HEREDOC page.within("#diff-notes-app") do - fill_in("note_note", with: markdown) + fill_in("note-body", with: markdown) end end diff --git a/spec/features/issuables/shortcuts_issuable_spec.rb b/spec/features/issuables/shortcuts_issuable_spec.rb index e25fd1a6249..0a19086ffbd 100644 --- a/spec/features/issuables/shortcuts_issuable_spec.rb +++ b/spec/features/issuables/shortcuts_issuable_spec.rb @@ -12,6 +12,15 @@ feature 'Blob shortcuts', :js do sign_in(user) end + shared_examples "quotes the selected text" do + it "quotes the selected text" do + select_element('.note-text') + find('body').native.send_key('r') + + expect(find('.js-main-target-form .js-vue-comment-form').value).to include(note_text) + end + end + describe 'pressing "r"' do describe 'On an Issue' do before do @@ -20,12 +29,7 @@ feature 'Blob shortcuts', :js do wait_for_requests end - it 'quotes the selected text' do - select_element('.note-text') - find('body').native.send_key('r') - - expect(find('.js-main-target-form .js-vue-comment-form').value).to include(note_text) - end + include_examples 'quotes the selected text' end describe 'On a Merge Request' do @@ -35,12 +39,7 @@ feature 'Blob shortcuts', :js do wait_for_requests end - it 'quotes the selected text' do - select_element('.note-text') - find('body').native.send_key('r') - - expect(find('.js-main-target-form #note_note').value).to include(note_text) - end + include_examples 'quotes the selected text' end end end -- cgit v1.2.1