diff options
author | Igor <idrozdov@gitlab.com> | 2019-09-06 15:49:13 +0000 |
---|---|---|
committer | Stan Hu <stanhu@gmail.com> | 2019-09-06 15:49:13 +0000 |
commit | e8a4ee8ad3987d5c08a07b76a83f3ccef4c546a9 (patch) | |
tree | 085822a3fb825c9fc3bd6634e14182c24c2554b7 /spec/features/merge_request/user_posts_notes_spec.rb | |
parent | 05fca5ff1558433029eb9771e582b99399a3eaaa (diff) | |
download | gitlab-ce-e8a4ee8ad3987d5c08a07b76a83f3ccef4c546a9.tar.gz |
Fix sharing localStorage with all MRs
Expose id field in the serializer in order
to store comments content in the localStorage
under the correct key
Diffstat (limited to 'spec/features/merge_request/user_posts_notes_spec.rb')
-rw-r--r-- | spec/features/merge_request/user_posts_notes_spec.rb | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/spec/features/merge_request/user_posts_notes_spec.rb b/spec/features/merge_request/user_posts_notes_spec.rb index 435b3cd2555..7d89b8e97a6 100644 --- a/spec/features/merge_request/user_posts_notes_spec.rb +++ b/spec/features/merge_request/user_posts_notes_spec.rb @@ -5,7 +5,8 @@ require 'spec_helper' describe 'Merge request > User posts notes', :js do include NoteInteractionHelpers - let(:project) { create(:project, :repository) } + set(:project) { create(:project, :repository) } + let(:user) { project.creator } let(:merge_request) do create(:merge_request, source_project: project, target_project: project) @@ -33,17 +34,21 @@ describe 'Merge request > User posts notes', :js do end describe 'with text' do + let(:text) { 'This is awesome' } + before do page.within('.js-main-target-form') do - fill_in 'note[note]', with: 'This is awesome' + fill_in 'note[note]', with: text end end - it 'has enable submit button and preview button' do + it 'has enable submit button, preview button and saves content to local storage' do page.within('.js-main-target-form') do expect(page).not_to have_css('.js-comment-button[disabled]') expect(page).to have_css('.js-md-preview-button', visible: true) end + + expect(page.evaluate_script("localStorage['autosave/Note/MergeRequest/#{merge_request.id}']")).to eq(text) end end end |