debian-mirror-gitlab/features/steps/project/merge_requests/acceptance.rb

57 lines
1.7 KiB
Ruby
Raw Normal View History

2015-12-23 02:04:40 +05:30
class Spinach::Features::ProjectMergeRequestsAcceptance < Spinach::FeatureSteps
include LoginHelpers
include GitlabRoutingHelper
2017-08-17 22:00:37 +05:30
include WaitForVueResource
2015-12-23 02:04:40 +05:30
step 'I am on the Merge Request detail page' do
visit merge_request_path(@merge_request)
end
step 'I am on the Merge Request detail with note anchor page' do
visit merge_request_path(@merge_request, anchor: 'note_123')
end
2017-08-17 22:00:37 +05:30
step 'I uncheck the "Remove source branch" option' do
uncheck('Remove source branch')
end
step 'I check the "Remove source branch" option' do
2015-12-23 02:04:40 +05:30
check('Remove source branch')
end
step 'I click on Accept Merge Request' do
2017-08-17 22:00:37 +05:30
click_button('Merge')
2015-12-23 02:04:40 +05:30
end
step 'I should see the Remove Source Branch button' do
2017-08-17 22:00:37 +05:30
expect(page).to have_selector('.js-remove-branch-button')
# Wait for View Resource requests to complete so they don't blow up if they are
# only handled after `DatabaseCleaner` has already run
wait_for_vue_resource
2015-12-23 02:04:40 +05:30
end
step 'I should not see the Remove Source Branch button' do
2017-08-17 22:00:37 +05:30
expect(page).not_to have_selector('.js-remove-branch-button')
# Wait for View Resource requests to complete so they don't blow up if they are
# only handled after `DatabaseCleaner` has already run
wait_for_vue_resource
2015-12-23 02:04:40 +05:30
end
step 'There is an open Merge Request' do
@user = create(:user)
2017-08-17 22:00:37 +05:30
@project = create(:project, :public, :repository)
2016-06-02 11:05:42 +05:30
@project_member = create(:project_member, :developer, user: @user, project: @project)
2015-12-23 02:04:40 +05:30
@merge_request = create(:merge_request, :with_diffs, :simple, source_project: @project)
end
step 'I am signed in as a developer of the project' do
2017-08-17 22:00:37 +05:30
sign_in(@user)
2015-12-23 02:04:40 +05:30
end
step 'I should see merge request merged' do
expect(page).to have_content('The changes were merged into')
end
end