2017-04-12 11:30:28 +00:00
|
|
|
require 'spec_helper'
|
|
|
|
|
2017-10-13 05:13:07 +00:00
|
|
|
describe 'Discussion Comments Commit', :js do
|
2017-04-12 11:30:28 +00:00
|
|
|
include RepoHelpers
|
|
|
|
|
|
|
|
let(:user) { create(:user) }
|
2017-08-01 18:51:52 +00:00
|
|
|
let(:project) { create(:project, :repository) }
|
2017-04-12 11:30:28 +00:00
|
|
|
let(:merge_request) { create(:merge_request, source_project: project) }
|
2019-06-27 07:42:18 +00:00
|
|
|
let!(:commit_discussion_note1) { create(:discussion_note_on_commit, project: project) }
|
|
|
|
let!(:commit_discussion_note2) { create(:discussion_note_on_commit, in_reply_to: commit_discussion_note1) }
|
2017-04-12 11:30:28 +00:00
|
|
|
|
|
|
|
before do
|
2018-07-11 14:36:08 +00:00
|
|
|
project.add_maintainer(user)
|
2017-06-21 23:44:10 +00:00
|
|
|
sign_in(user)
|
2017-04-12 11:30:28 +00:00
|
|
|
|
2017-07-06 16:20:50 +00:00
|
|
|
visit project_commit_path(project, sample_commit.id)
|
2017-04-12 11:30:28 +00:00
|
|
|
end
|
|
|
|
|
|
|
|
it_behaves_like 'discussion comments', 'commit'
|
2019-06-27 07:42:18 +00:00
|
|
|
|
|
|
|
it 'has class .js-note-emoji' do
|
|
|
|
expect(page).to have_css('.js-note-emoji')
|
|
|
|
end
|
|
|
|
|
|
|
|
it 'adds award to the correct note' do
|
|
|
|
find("#note_#{commit_discussion_note2.id} .js-note-emoji").click
|
|
|
|
first('.emoji-menu .js-emoji-btn').click
|
|
|
|
|
|
|
|
wait_for_requests
|
|
|
|
|
|
|
|
expect(find("#note_#{commit_discussion_note1.id}")).not_to have_css('.js-awards-block')
|
|
|
|
expect(find("#note_#{commit_discussion_note2.id}")).to have_css('.js-awards-block')
|
|
|
|
end
|
2017-04-12 11:30:28 +00:00
|
|
|
end
|