summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorFatih Acet <acetfatih@gmail.com>2017-01-02 21:37:37 +0300
committerFatih Acet <acetfatih@gmail.com>2017-01-04 23:37:54 +0300
commite3d92a6cb4ee9cfa2e5283a3b9d2d91be3a232fa (patch)
tree804ca3dbcec8e1a053ebee448d26492640b81e73 /spec
parent09fc4f557b4967e2c40ec17da07d17b3a637b0d5 (diff)
downloadgitlab-ce-e3d92a6cb4ee9cfa2e5283a3b9d2d91be3a232fa.tar.gz
Add spec for note edit and fix one commented spec.
Diffstat (limited to 'spec')
-rw-r--r--spec/features/notes_on_merge_requests_spec.rb33
1 files changed, 24 insertions, 9 deletions
diff --git a/spec/features/notes_on_merge_requests_spec.rb b/spec/features/notes_on_merge_requests_spec.rb
index d93f1ef8f81..b785b2f7704 100644
--- a/spec/features/notes_on_merge_requests_spec.rb
+++ b/spec/features/notes_on_merge_requests_spec.rb
@@ -78,7 +78,7 @@ describe 'Comments', feature: true do
describe 'editing the note' do
before do
find('.note').hover
- find(".js-note-edit").click
+ find('.js-note-edit').click
end
it 'shows the note edit form and hide the note body' do
@@ -89,14 +89,29 @@ describe 'Comments', feature: true do
end
end
- # TODO: fix after 7.7 release
- # it "should reset the edit note form textarea with the original content of the note if cancelled" do
- # within(".current-note-edit-form") do
- # fill_in "note[note]", with: "Some new content"
- # find(".btn-cancel").click
- # expect(find(".js-note-text", visible: false).text).to eq note.note
- # end
- # end
+ it 'should reset the edit note form textarea with the original content of the note if cancelled' do
+ within('.current-note-edit-form') do
+ fill_in 'note[note]', with: 'Some new content'
+ find('.btn-cancel').click
+ expect(find('.js-note-text', visible: false).text).to eq ''
+ end
+ end
+
+ it 'allows using markdown buttons after saving a note and then trying to edit it again' do
+ page.within('.current-note-edit-form') do
+ fill_in 'note[note]', with: 'This is the new content'
+ find('.btn-save').click
+ end
+
+ find('.note').hover
+ find('.js-note-edit').click
+
+ page.within('.current-note-edit-form') do
+ expect(find('#note_note').value).to eq('This is the new content')
+ find('.js-md:first-child').click
+ expect(find('#note_note').value).to eq('This is the new content****')
+ end
+ end
it 'appends the edited at time to the note' do
page.within('.current-note-edit-form') do