Commit 88e88edd authored by Hussain Kashef's avatar Hussain Kashef

q parameters passed to the method

parent 9b74a1f3
Pipeline #52933 passed with stage
in 38 minutes and 26 seconds
......@@ -22,7 +22,7 @@ class AssignmentsController < ApplicationController
def terminated_index
authorize Assignment
set_default_filter(termination_verified_by_id_not_null: 'true')
set_default_filter(termination_verified_by_id_null: 'true')
@q = policy_scope(Assignment).ended.ransack(params[:q])
@assignments = @q.result.paginate(page: params[:page])
end
......@@ -135,7 +135,7 @@ class AssignmentsController < ApplicationController
def verify_termination
@assignment.verify_termination(current_user)
redirect_back(fallback_location: terminated_index_assignments_path)
redirect_to terminated_index_assignments_path(q: { termination_verified_by_id_not_null: true })
flash[:notice] = 'Der Einsatz wurde erfolgreich quittiert.'
end
......
......@@ -3,7 +3,7 @@ require 'selenium/webdriver'
Capybara.register_driver :chrome_headless do |app|
chrome_options = {
chromeOptions: { args: %w[headless disable-gpu no-sandbox window-size=1600x2000] }
chromeOptions: { args: %w[headless disable-gpu no-sandbox window-size=1600x2000], w3c: false }
}
capabilities = Selenium::WebDriver::Remote::Capabilities.chrome(chrome_options)
Capybara::Selenium::Driver.new(app, browser: :chrome, desired_capabilities: capabilities)
......
......@@ -53,8 +53,8 @@ class AssignmentTerminationIndexTest < ApplicationSystemTestCase
test 'filtering_for_only_verified' do
visit terminated_index_assignments_path
click_link 'Quittiert: Quittiert'
click_link exact_text: 'Unquittiert'
click_link 'Quittiert: Unquittiert'
click_link exact_text: 'Quittiert'
visit current_url
refute_text termination_index_table_text(@un_submitted)
refute_text termination_index_table_text(@submitted)
......@@ -69,12 +69,10 @@ class AssignmentTerminationIndexTest < ApplicationSystemTestCase
refute_text termination_index_table_text(@verified)
page.find_all('a', text: 'Beendigung Quittieren').first.click
click_link 'Beendigung Quittieren'
assert_text 'Beendete Begleitungen'
refute_text termination_index_table_text(@un_submitted)
refute_text termination_index_table_text(@submitted)
refute_text termination_index_table_text(@verified)
click_link 'Quittiert: Quittiert'
click_link exact_text: 'Unquittiert'
end
test 'clear_filter_link_is_working_correctly' do
......@@ -116,8 +114,6 @@ class AssignmentTerminationIndexTest < ApplicationSystemTestCase
test 'assignment_quittieren_creates_a_assignment_log_record_from_assignment' do
visit terminated_index_assignments_path
click_link 'Quittiert: Quittiert'
click_link exact_text: 'Unquittiert'
click_link 'Beendigung Quittieren', href: verify_termination_assignment_path(@submitted.id)
assert_text 'Der Einsatz wurde erfolgreich quittiert.'
assert_equal @submitted, AssignmentLog.find_by(assignment_id: @submitted.id).assignment
......
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