Commit a8f0590f authored by Michel Engelen's avatar Michel Engelen Committed by Michel Engelen

updated test

parent e671ab06
require 'rails_helper' require 'rails_helper'
describe 'Resolve an open discussion in a merge request by creating an issue', :js do describe 'Resolve an open thread in a merge request by creating an issue', :js do
let(:user) { create(:user) } let(:user) { create(:user) }
let(:project) { create(:project, :repository, only_allow_merge_if_all_discussions_are_resolved: true) } let(:project) { create(:project, :repository, only_allow_merge_if_all_discussions_are_resolved: true) }
let(:merge_request) { create(:merge_request, source_project: project) } let(:merge_request) { create(:merge_request, source_project: project) }
...@@ -30,7 +30,7 @@ describe 'Resolve an open discussion in a merge request by creating an issue', : ...@@ -30,7 +30,7 @@ describe 'Resolve an open discussion in a merge request by creating an issue', :
end end
end end
context 'resolving the discussion' do context 'resolving the thread' do
before do before do
click_button 'Resolve thread' click_button 'Resolve thread'
end end
...@@ -39,7 +39,7 @@ describe 'Resolve an open discussion in a merge request by creating an issue', : ...@@ -39,7 +39,7 @@ describe 'Resolve an open discussion in a merge request by creating an issue', :
expect(page).not_to have_css resolve_discussion_selector expect(page).not_to have_css resolve_discussion_selector
end end
it 'shows the link for creating a new issue when unresolving a discussion' do it 'shows the link for creating a new issue when unresolving a thread' do
page.within '.diff-content' do page.within '.diff-content' do
click_button 'Unresolve thread' click_button 'Unresolve thread'
end end
...@@ -48,7 +48,7 @@ describe 'Resolve an open discussion in a merge request by creating an issue', : ...@@ -48,7 +48,7 @@ describe 'Resolve an open discussion in a merge request by creating an issue', :
end end
end end
it 'has a link to create a new issue for a discussion' do it 'has a link to create a new issue for a thread' do
expect(page).to have_css resolve_discussion_selector expect(page).to have_css resolve_discussion_selector
end end
...@@ -57,13 +57,13 @@ describe 'Resolve an open discussion in a merge request by creating an issue', : ...@@ -57,13 +57,13 @@ describe 'Resolve an open discussion in a merge request by creating an issue', :
find(resolve_discussion_selector).click find(resolve_discussion_selector).click
end end
it 'has a hidden field for the discussion' do it 'has a hidden field for the thread' do
discussion_field = find('#discussion_to_resolve', visible: false) discussion_field = find('#discussion_to_resolve', visible: false)
expect(discussion_field.value).to eq(discussion.id.to_s) expect(discussion_field.value).to eq(discussion.id.to_s)
end end
it_behaves_like 'creating an issue for a discussion' it_behaves_like 'creating an issue for a thread'
end end
end end
...@@ -75,8 +75,8 @@ describe 'Resolve an open discussion in a merge request by creating an issue', : ...@@ -75,8 +75,8 @@ describe 'Resolve an open discussion in a merge request by creating an issue', :
discussion_to_resolve: discussion.id) discussion_to_resolve: discussion.id)
end end
it 'Shows a notice to ask someone else to resolve the discussions' do it 'Shows a notice to ask someone else to resolve the threads' do
expect(page).to have_content("The discussion at #{merge_request.to_reference}"\ expect(page).to have_content("The thread at #{merge_request.to_reference}"\
" (discussion #{discussion.first_note.id}) will stay unresolved."\ " (discussion #{discussion.first_note.id}) will stay unresolved."\
" Ask someone with permission to resolve it.") " Ask someone with permission to resolve it.")
end end
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment