Commit 6101c2d4 authored by Tugce Nur Tas's avatar Tugce Nur Tas Committed by Tuğçe Nur Taş
Browse files

adapt tests for soft deletion

parent be4fcd8f
......@@ -4,7 +4,7 @@ class UsersTest < ApplicationSystemTestCase
setup do
@emails = ActionMailer::Base.deliveries
@emails.clear
@user = create :user, email: 'superadmin@example.com'
@user = create :user, email: 'superadmin@example.com', role: 'superadmin'
login_as @user
visit new_user_path
end
......@@ -64,4 +64,12 @@ class UsersTest < ApplicationSystemTestCase
email = ActionMailer::Base.deliveries.last
assert_equal 'superadmin@test.ch', email['to'].to_s
end
test 'superadmins have no destroy link' do
visit users_path
@social_worker = create :user, role: 'social_worker'
@department_manager = create :user, role: 'department_manager'
assert_not page.has_link? 'Delete'
end
end
Supports Markdown
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