Commit d07ef089 authored by Grzegorz Bizon's avatar Grzegorz Bizon

Rename MWPS in user interface and feature tests

parent bd3ae192
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
- if @pipeline && @pipeline.active? - if @pipeline && @pipeline.active?
%span.btn-group %span.btn-group
= button_tag class: "btn btn-create js-merge-button merge_when_build_succeeds" do = button_tag class: "btn btn-create js-merge-button merge_when_build_succeeds" do
Merge When Build Succeeds Merge When Pipeline Succeeds
- unless @project.only_allow_merge_if_build_succeeds? - unless @project.only_allow_merge_if_build_succeeds?
= button_tag class: "btn btn-success dropdown-toggle", 'data-toggle' => 'dropdown' do = button_tag class: "btn btn-success dropdown-toggle", 'data-toggle' => 'dropdown' do
= icon('caret-down') = icon('caret-down')
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
%li %li
= link_to "#", class: "merge_when_build_succeeds" do = link_to "#", class: "merge_when_build_succeeds" do
= icon('check fw') = icon('check fw')
Merge When Build Succeeds Merge When Pipeline Succeeds
%li %li
= link_to "#", class: "accept_merge_request" do = link_to "#", class: "accept_merge_request" do
= icon('warning fw') = icon('warning fw')
......
require 'spec_helper' require 'spec_helper'
feature 'Merge When Build Succeeds', feature: true, js: true do feature 'Merge When Pipeline Succeeds', :feature, :js do
let(:user) { create(:user) } let(:user) { create(:user) }
let(:project) { create(:project, :public) } let(:project) { create(:project, :public) }
...@@ -18,7 +18,7 @@ feature 'Merge When Build Succeeds', feature: true, js: true do ...@@ -18,7 +18,7 @@ feature 'Merge When Build Succeeds', feature: true, js: true do
before { project.team << [user, :master] } before { project.team << [user, :master] }
context 'when there is active build for merge request' do context 'when there is active pipeline for merge request' do
background do background do
create(:ci_build, pipeline: pipeline) create(:ci_build, pipeline: pipeline)
end end
...@@ -28,16 +28,16 @@ feature 'Merge When Build Succeeds', feature: true, js: true do ...@@ -28,16 +28,16 @@ feature 'Merge When Build Succeeds', feature: true, js: true do
visit_merge_request(merge_request) visit_merge_request(merge_request)
end end
it 'displays the Merge When Build Succeeds button' do it 'displays the Merge When Pipeline Succeeds button' do
expect(page).to have_button "Merge When Build Succeeds" expect(page).to have_button "Merge When Pipeline Succeeds"
end end
context "Merge When Build succeeds enabled" do context "Merge When Pipeline Succeeds enabled" do
before do before do
click_button "Merge When Build Succeeds" click_button "Merge When Pipeline Succeeds"
end end
it 'activates Merge When Build Succeeds feature' do it 'activates Merge When Pipeline Succeeds feature' do
expect(page).to have_link "Cancel Automatic Merge" expect(page).to have_link "Cancel Automatic Merge"
expect(page).to have_content "Set by #{user.name} to be merged automatically when the pipeline succeeds." expect(page).to have_content "Set by #{user.name} to be merged automatically when the pipeline succeeds."
...@@ -49,7 +49,7 @@ feature 'Merge When Build Succeeds', feature: true, js: true do ...@@ -49,7 +49,7 @@ feature 'Merge When Build Succeeds', feature: true, js: true do
end end
end end
context 'when merge when build succeeds is enabled' do context 'when merge when pipeline succeeds is enabled' do
let(:merge_request) do let(:merge_request) do
create(:merge_request_with_diffs, :simple, source_project: project, create(:merge_request_with_diffs, :simple, source_project: project,
author: user, author: user,
...@@ -70,7 +70,7 @@ feature 'Merge When Build Succeeds', feature: true, js: true do ...@@ -70,7 +70,7 @@ feature 'Merge When Build Succeeds', feature: true, js: true do
it 'allows to cancel the automatic merge' do it 'allows to cancel the automatic merge' do
click_link "Cancel Automatic Merge" click_link "Cancel Automatic Merge"
expect(page).to have_button "Merge When Build Succeeds" expect(page).to have_button "Merge When Pipeline Succeeds"
visit_merge_request(merge_request) # refresh the page visit_merge_request(merge_request) # refresh the page
expect(page).to have_content "canceled the automatic merge" expect(page).to have_content "canceled the automatic merge"
...@@ -83,7 +83,7 @@ feature 'Merge When Build Succeeds', feature: true, js: true do ...@@ -83,7 +83,7 @@ feature 'Merge When Build Succeeds', feature: true, js: true do
expect(page).to have_content "The source branch will be removed" expect(page).to have_content "The source branch will be removed"
end end
context 'when build succeeds' do context 'when pipeline succeeds' do
background { build.success } background { build.success }
it 'merges merge request' do it 'merges merge request' do
...@@ -95,10 +95,11 @@ feature 'Merge When Build Succeeds', feature: true, js: true do ...@@ -95,10 +95,11 @@ feature 'Merge When Build Succeeds', feature: true, js: true do
end end
end end
context 'when build is not active' do context 'when pipeline is not active' do
it "does not allow to enable merge when build succeeds" do it "does not allow to enable merge when pipeline succeeds" do
visit_merge_request(merge_request) visit_merge_request(merge_request)
expect(page).not_to have_link "Merge When Build Succeeds"
expect(page).not_to have_link 'Merge When Pipeline Succeeds'
end end
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