Commit 57bbfe52 authored by Kaspar Vollenweider's avatar Kaspar Vollenweider 👻
Browse files

Merge branch 'features/client_beenden' into 'develop'

Features/client beenden

See merge request !467
parents 3ab62797 c0a5c71d
Pipeline #13964 passed with stage
in 22 minutes and 36 seconds
......@@ -142,18 +142,6 @@ class ClientsTest < ApplicationSystemTestCase
refute page.has_text? 'Fluent'
end
test 'superadmin_can_delete_client' do
login_as @superadmin
client = create :client
visit client_path(client)
page.accept_confirm do
first('a', text: 'Löschen').click
end
assert page.has_text? 'Client was successfully deleted.'
end
test 'client_pagination' do
login_as @superadmin
70.times do
......@@ -183,22 +171,6 @@ class ClientsTest < ApplicationSystemTestCase
"#{I18n.l(with_assignment.created_at.to_date)} Angemeldet with_assignment Show Edit"
end
test 'can_delete_a_client_through_edit' do
client = create :client
login_as @superadmin
visit clients_path
assert page.has_text? client
visit edit_client_path(client)
page.accept_confirm do
click_link 'Löschen'
end
assert page.has_text? 'Client was successfully deleted.'
refute page.has_text? client
end
test 'all_needed_actions_are_available_in_the_index' do
client = create :client
social_worker = create :social_worker
......@@ -209,7 +181,6 @@ class ClientsTest < ApplicationSystemTestCase
visit clients_path
assert page.has_link? 'Show', count: 3
assert page.has_link? 'Edit', count: 3
refute page.has_link? 'Löschen'
login_as @department_manager
visit clients_path
......
......@@ -59,4 +59,23 @@ class ActiveSupport::TestCase
def assert_xls_row_empty(wb, row, cols = 8)
(1..cols).to_a.each { |column| assert_nil wb.cell(row, column) }
end
def controllers_action_list(controller_name = nil)
controller_name ||= self.class.name.remove('PolicyTest').underscore.pluralize
Rails
.application.routes.routes
.find_all { |route| route.defaults[:controller] == controller_name.to_s }
.map { |route| route.defaults[:action] }.uniq
.map { |action| [action.to_sym, "#{action}?"] }.to_h
end
def actions_list(*choices)
if choices.any?
controllers_action_list.values_at(
*choices.map { |choice| choice.to_s.remove(/\?$/).to_sym }
)
else
controllers_action_list
end
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