Improve specs when loading slowly

pull/6827/head
Oliver Günther 7 years ago
parent 8c981a681a
commit d549c414b0
No known key found for this signature in database
GPG Key ID: 88872239EB414F99
  1. 4
      spec/features/administration_spec.rb
  2. 2
      spec/lib/synchronization_spec.rb

@ -53,8 +53,12 @@ describe 'LDAP group sync administration spec', type: :feature, js: true do
memberships = sync.users.pluck(:id) memberships = sync.users.pluck(:id)
visit ldap_groups_synchronized_groups_path visit ldap_groups_synchronized_groups_path
expect_angular_frontend_initialized
find('.buttons a', text: 'Delete').click find('.buttons a', text: 'Delete').click
find('.danger-zone--verification input').set 'attr' find('.danger-zone--verification input').set 'attr'
sleep 2
click_on 'Delete' click_on 'Delete'
expect(page).to have_selector('.flash.notice', text: I18n.t(:notice_successful_delete)) expect(page).to have_selector('.flash.notice', text: I18n.t(:notice_successful_delete))

@ -122,7 +122,7 @@ describe OpenProject::LdapGroups::Synchronization, with_ee: %i[ldap_groups] do
expect(::LdapGroups::Membership.where(group_id: synced_foo_id).count).to eq(1) expect(::LdapGroups::Membership.where(group_id: synced_foo_id).count).to eq(1)
synced_foo.destroy synced_foo.destroy
expect { group_foo.reload }.not_to raise_error ActiveRecord::RecordNotFound expect { group_foo.reload }.not_to raise_error
expect(::LdapGroups::Membership.where(group_id: synced_foo_id)).to be_empty expect(::LdapGroups::Membership.where(group_id: synced_foo_id)).to be_empty
end end

Loading…
Cancel
Save