@object = ContainerRequest.new
- # If "no reuse" requested, pass the correct argument to arvados-cwl-runner command.
- if params[:no_reuse] and src.command[0] == 'arvados-cwl-runner'
- command = src.command - ['--enable-reuse']
- command.insert(1, '--disable-reuse')
+ if params[:no_reuse]
+ @object.use_existing = false
+ # If "no reuse" requested, pass the correct argument to arvados-cwl-runner command.
+ if src.command[0] == 'arvados-cwl-runner'
+ command = src.command - ['--enable-reuse']
+ command.insert(1, '--disable-reuse')
+ end
else
command = src.command
end
assert_equal completed_cr['cmd'], copied_cr['cmd']
assert_equal completed_cr['runtime_constraints']['ram'], copied_cr['runtime_constraints'][:ram]
end
+
+ test "container request copy without reuse" do
+ completed_cr = api_fixture('container_requests')['completed']
+ post(:copy, {id: completed_cr['uuid']}, session_for(:active))
+ assert_response 302
+ copied_cr = assigns(:object)
+ assert_not_nil copied_cr
+ refute copied_cr['use_existing']
+ end
end