Verified Commit b0b75bb0 authored by Kaspar Vollenweider's avatar Kaspar Vollenweider 👻
Browse files

fix client activity filter test

parent a40702b4
Pipeline #13932 failed with stage
in 18 minutes and 36 seconds
......@@ -7,54 +7,50 @@ class ClientActivityFilterTest < ActionDispatch::IntegrationTest
create :assignment_active, client: @client_accepted
@client_rejected = create :client, acceptance: 'rejected'
create :assignment_active, client: @client_rejected
@client_resigned = create :client, acceptance: 'resigned'
create :assignment_active, client: @client_resigned
@client_resigned = create :client, acceptance: 'accepted'
create :assignment_active, client: @client_resigned, period_end: 2.days.ago
@client_resigned.resigned!
login_as @superadmin
end
test 'client_tandem_active_filter_returns_accepted_active_client' do
get clients_path(q: { active_eq: 'true' })
get clients_path(q: { active: 'true' })
assert response.body.include? @client_accepted.contact.full_name
refute response.body.include? @client_rejected.contact.full_name
refute response.body.include? @client_resigned.contact.full_name
end
test 'client_tandem_inactive_filter_returns_accepted_inactive_client' do
get clients_path(q: { active_eq: 'false' })
get clients_path(q: { inactive: 'true' })
refute response.body.include? @client_accepted.contact.full_name
refute response.body.include? @client_rejected.contact.full_name
refute response.body.include? @client_resigned.contact.full_name
end
test 'client_acceptance_tandem_filters_work_together' do
get clients_path(q: { acceptance_eq: '0', active_eq: 'true' })
get clients_path(q: { acceptance_eq: '0', active: 'true' })
assert response.body.include? @client_accepted.contact.full_name
refute response.body.include? @client_rejected.contact.full_name
refute response.body.include? @client_resigned.contact.full_name
get clients_path(q: { acceptance_eq: '0', active_eq: 'false' })
get clients_path(q: { acceptance_eq: '0', inactive: 'true' })
refute response.body.include? @client_accepted.contact.full_name
refute response.body.include? @client_rejected.contact.full_name
refute response.body.include? @client_resigned.contact.full_name
get clients_path(q: { acceptance_eq: '1', active_eq: 'true' })
get clients_path(q: { acceptance_eq: '1', active: 'true' })
refute response.body.include? @client_accepted.contact.full_name
refute response.body.include? @client_rejected.contact.full_name
refute response.body.include? @client_resigned.contact.full_name
get clients_path(q: { acceptance_eq: '1', active_eq: 'false' })
get clients_path(q: { acceptance_eq: '1', inactive: 'true' })
refute response.body.include? @client_accepted.contact.full_name
refute response.body.include? @client_rejected.contact.full_name
refute response.body.include? @client_resigned.contact.full_name
get clients_path(q: { acceptance_eq: '2', active_eq: 'true' })
get clients_path(q: { acceptance_eq: '2' })
refute response.body.include? @client_accepted.contact.full_name
refute response.body.include? @client_rejected.contact.full_name
refute response.body.include? @client_resigned.contact.full_name
get clients_path(q: { acceptance_eq: '2', active_eq: 'false' })
refute response.body.include? @client_accepted.contact.full_name
refute response.body.include? @client_rejected.contact.full_name
refute response.body.include? @client_resigned.contact.full_name
assert response.body.include? @client_resigned.contact.full_name
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