Project

General

Profile

Defect #33059 » diff.patch

Mizuki ISHIKAWA, 2020-02-28 09:33

View differences:

app/controllers/workflows_controller.rb
def find_roles
ids = Array.wrap(params[:role_id])
if ids == ['all']
@roles = Role.sorted.to_a
@roles = Role.sorted.select(&:consider_workflow?)
elsif ids.present?
@roles = Role.where(:id => ids).to_a
end
test/functional/workflows_controller_test.rb
get :edit, :params => {:role_id => 'all', :tracker_id => 'all'}
assert_response :success
assert_select 'select[name=?][multiple=multiple]', 'role_id[]' do
assert_select 'option[selected=selected]', Role.all.count(&:consider_workflow?)
assert_select 'select[name=?]', 'role_id[]' do
assert_select 'option[selected=selected][value=all]'
end
assert_select 'select[name=?]', 'tracker_id[]' do
assert_select 'option[selected=selected][value=all]'
(1-1/3)