@@ -17,46 +17,28 @@ RSpec.describe 'User reverts a merge request', :js do
wait_for_requests
visit(merge_request_path(merge_request))
# do not reload the page by visiting, let javascript update the page as it will validate we have loaded the modal
# code correctly on page update that adds the `revert` button
end
it'reverts a merge request',:sidekiq_might_not_need_inlinedo
find("a[href='#modal-revert-commit']").click
revert_commit
page.within('#modal-revert-commit')do
uncheck('create_merge_request')
click_button('Revert')
end
wait_for_requests
expect(page).tohave_content('The merge request has been successfully reverted.')
wait_for_requests
end
it'does not revert a merge request that was previously reverted',:sidekiq_might_not_need_inlinedo
find("a[href='#modal-revert-commit']").click
revert_commit
page.within('#modal-revert-commit')do
uncheck('create_merge_request')
click_button('Revert')
end
find("a[href='#modal-revert-commit']").click
page.within('#modal-revert-commit')do
uncheck('create_merge_request')
click_button('Revert')
end
revert_commit
expect(page).tohave_content('Sorry, we cannot revert this merge request automatically.')
end
it'reverts a merge request in a new merge request',:sidekiq_might_not_need_inlinedo
find("a[href='#modal-revert-commit']").click
page.within('#modal-revert-commit')do
click_button('Revert')
end
revert_commit(create_merge_request: true)
expect(page).tohave_content('The merge request has been successfully reverted. You can now submit a merge request to get this change into the original branch.')
end
...
...
@@ -68,4 +50,13 @@ RSpec.describe 'User reverts a merge request', :js do