Commit e4e39814 authored by Oswaldo Ferreira's avatar Oswaldo Ferreira

Replace wait_for_ajax with wait_for_vue_resource on approvals spec

parent a6385088
require 'rails_helper'
feature 'Merge request approvals', js: true, feature: true do
include WaitForAjax
include WaitForVueResource
let(:user) { create(:user) }
let(:project) { create(:project, approvals_before_merge: 1) }
......@@ -74,7 +74,7 @@ feature 'Merge request approvals', js: true, feature: true do
visit new_namespace_project_merge_request_path(project.namespace, project, merge_request: { target_branch: 'master', source_branch: 'feature' })
find('#s2id_merge_request_approver_group_ids .select2-input').click
wait_for_ajax
wait_for_vue_resource
expect(find('.select2-results')).to have_content(group.name)
......@@ -103,7 +103,7 @@ feature 'Merge request approvals', js: true, feature: true do
click_on("Submit merge request")
wait_for_ajax
wait_for_vue_resource
expect(page).not_to have_selector(".approvals-required-text a[title='#{other_user.name}']")
expect(page).to have_selector(".approvals-required-text a[title='#{approver.name}']")
......@@ -129,14 +129,14 @@ feature 'Merge request approvals', js: true, feature: true do
visit edit_namespace_project_merge_request_path(project.namespace, project, merge_request)
find('#s2id_merge_request_approver_group_ids .select2-input').click
wait_for_ajax
wait_for_vue_resource
expect(find('.select2-results')).to have_content(group.name)
find('.select2-results').click
click_on("Save changes")
wait_for_ajax
wait_for_vue_resource
find('.approvals-components')
expect(page).to have_content("Requires 1 more approval")
end
......@@ -236,7 +236,7 @@ feature 'Merge request approvals', js: true, feature: true do
it 'I am able to approve' do
approve_merge_request
wait_for_ajax
wait_for_vue_resource
expect(page).to have_content('Approved by')
expect(page).to have_css('.approver-avatar')
end
......@@ -259,7 +259,7 @@ feature 'Merge request approvals', js: true, feature: true do
# before approval status is loaded
expect(page).to have_button('Merge when pipeline succeeds', disabled: true)
wait_for_ajax
wait_for_vue_resource
# after approval status is loaded
expect(page).to have_button('Merge when pipeline succeeds', disabled: true)
......@@ -285,7 +285,7 @@ feature 'Merge request approvals', js: true, feature: true do
# before approval status is loaded
expect(page).to have_button("Rebase", disabled: true)
wait_for_ajax
wait_for_vue_resource
# after approval status is loaded
expect(page).to have_button("Rebase", disabled: true)
......@@ -320,12 +320,12 @@ def approve_merge_request
page.within '.mr-state-widget' do
find('.approve-btn').click
end
wait_for_ajax
wait_for_vue_resource
end
def unapprove_merge_request
page.within '.mr-state-widget' do
find('.unapprove-btn-wrap').click
end
wait_for_ajax
wait_for_vue_resource
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