Commit 6b02c82c authored by Katarzyna Kobierska's avatar Katarzyna Kobierska

Improve grammar

parent 2e08f115
- if @merge_request.closed_without_fork? - if @merge_request.closed_without_fork?
.alert.alert-danger .alert.alert-danger
%p Source project is not a fork of the target project %p The source project of this merge request has been removed.
.clearfix.detail-page-header .clearfix.detail-page-header
.issuable-header .issuable-header
......
...@@ -134,7 +134,7 @@ ...@@ -134,7 +134,7 @@
title: 'Moving an issue will copy the discussion to a different project and close it here. All participants will be notified of the new location.' } title: 'Moving an issue will copy the discussion to a different project and close it here. All participants will be notified of the new location.' }
= icon('question-circle') = icon('question-circle')
- if issuable.is_a?(MergeRequest) && !@merge_request.closed_without_fork? - if issuable.is_a?(MergeRequest) && !issuable.closed_without_fork?
%hr %hr
- if @merge_request.new_record? - if @merge_request.new_record?
.form-group .form-group
......
...@@ -171,7 +171,7 @@ describe Projects::MergeRequestsController do ...@@ -171,7 +171,7 @@ describe Projects::MergeRequestsController do
expect(merge_request.reload.closed?).to be_truthy expect(merge_request.reload.closed?).to be_truthy
end end
it 'allow to edit closed MR' do it 'allows editing of a closed merge request' do
merge_request.close! merge_request.close!
put :update, put :update,
...@@ -186,7 +186,7 @@ describe Projects::MergeRequestsController do ...@@ -186,7 +186,7 @@ describe Projects::MergeRequestsController do
expect(merge_request.reload.title).to eq 'New title' expect(merge_request.reload.title).to eq 'New title'
end end
it 'does not allow to update target branch closed MR' do it 'does not allow to update target branch closed merge request' do
merge_request.close! merge_request.close!
put :update, put :update,
......
...@@ -969,7 +969,7 @@ describe MergeRequest, models: true do ...@@ -969,7 +969,7 @@ describe MergeRequest, models: true do
let(:user) { create(:user) } let(:user) { create(:user) }
let(:unlink_project) { Projects::UnlinkForkService.new(fork_project, user) } let(:unlink_project) { Projects::UnlinkForkService.new(fork_project, user) }
context "when fork exists" do context "when the fork exists" do
let(:merge_request) do let(:merge_request) do
create(:merge_request, create(:merge_request,
source_project: fork_project, source_project: fork_project,
...@@ -979,13 +979,13 @@ describe MergeRequest, models: true do ...@@ -979,13 +979,13 @@ describe MergeRequest, models: true do
it { expect(merge_request.fork_missing?).to be_falsey } it { expect(merge_request.fork_missing?).to be_falsey }
end end
context "when source project is the target project" do context "when the source project is the same as the target project" do
let(:merge_request) { create(:merge_request, source_project: project) } let(:merge_request) { create(:merge_request, source_project: project) }
it { expect(merge_request.fork_missing?).to be_falsey } it { expect(merge_request.fork_missing?).to be_falsey }
end end
context "when fork does not exist" do context "when the fork does not exist" do
let(:merge_request) do let(:merge_request) do
create(:merge_request, create(:merge_request,
source_project: fork_project, source_project: fork_project,
...@@ -1007,18 +1007,18 @@ describe MergeRequest, models: true do ...@@ -1007,18 +1007,18 @@ describe MergeRequest, models: true do
let(:user) { create(:user) } let(:user) { create(:user) }
let(:unlink_project) { Projects::UnlinkForkService.new(fork_project, user) } let(:unlink_project) { Projects::UnlinkForkService.new(fork_project, user) }
context "when merge request is closed" do context "when the merge request is closed" do
let(:closed_merge_request) do let(:closed_merge_request) do
create(:closed_merge_request, create(:closed_merge_request,
source_project: fork_project, source_project: fork_project,
target_project: project) target_project: project)
end end
it "returns false if fork exist" do it "returns false if the fork exist" do
expect(closed_merge_request.closed_without_fork?).to be_falsey expect(closed_merge_request.closed_without_fork?).to be_falsey
end end
it "returns true if fork doesn't exist" do it "returns true if the fork does not exist" do
unlink_project.execute unlink_project.execute
closed_merge_request.reload closed_merge_request.reload
...@@ -1026,7 +1026,7 @@ describe MergeRequest, models: true do ...@@ -1026,7 +1026,7 @@ describe MergeRequest, models: true do
end end
end end
context "when merge request is open" do context "when the merge request is open" do
let(:open_merge_request) do let(:open_merge_request) do
create(:merge_request, create(:merge_request,
source_project: fork_project, source_project: fork_project,
......
...@@ -24,7 +24,7 @@ describe 'projects/merge_requests/edit.html.haml' do ...@@ -24,7 +24,7 @@ describe 'projects/merge_requests/edit.html.haml' do
.and_return(User.find(closed_merge_request.author_id)) .and_return(User.find(closed_merge_request.author_id))
end end
context 'when closed merge request without fork' do context 'when a merge request without fork' do
it "shows editable fields" do it "shows editable fields" do
unlink_project.execute unlink_project.execute
closed_merge_request.reload closed_merge_request.reload
...@@ -39,7 +39,7 @@ describe 'projects/merge_requests/edit.html.haml' do ...@@ -39,7 +39,7 @@ describe 'projects/merge_requests/edit.html.haml' do
end end
end end
context 'when closed merge request with fork' do context 'when a merge request with an existing source project is closed' do
it "shows editable fields" do it "shows editable fields" do
render render
......
...@@ -22,16 +22,17 @@ describe 'projects/merge_requests/show.html.haml' do ...@@ -22,16 +22,17 @@ describe 'projects/merge_requests/show.html.haml' do
allow(view).to receive(:can?).and_return(true) allow(view).to receive(:can?).and_return(true)
end end
context 'when merge request is closed' do context 'when the merge request is closed' do
it 'shows Reopen button' do it 'shows the "Reopen" button' do
render render
expect(rendered).to have_css('a', visible: true, text: 'Reopen') expect(rendered).to have_css('a', visible: true, text: 'Reopen')
expect(rendered).to have_css('a', visible: false, text: 'Close') expect(rendered).to have_css('a', visible: false, text: 'Close')
end end
it 'does not show Reopen button without fork' do it 'does not show the "Reopen" button when the source project does not exist' do
fork_project.destroy fork_project.destroy
render render
expect(rendered).to have_css('a', visible: false, text: 'Reopen') expect(rendered).to have_css('a', visible: false, text: 'Reopen')
......
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