Skip to content

Commit

Permalink
Merge pull request #11045 from dmarcoux/refactor_trigger_webhooks_con…
Browse files Browse the repository at this point in the history
…trollers-fix_minitest_tests

Fix Minitest tests related to trigger_controller
  • Loading branch information
krauselukas committed Apr 26, 2021
2 parents bdbc3c1 + 6fcf612 commit afee6fd
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/api/app/controllers/trigger_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class TriggerController < ApplicationController
def create
authorize @token
@token.user.run_as do
@token.call(params.slice(:repository, :arch))
@token.call(params.slice(:repository, :arch).permit!)
render_ok
end
end
Expand Down
4 changes: 2 additions & 2 deletions src/api/test/functional/source_services_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -597,12 +597,12 @@ def test_run_service_via_token
post '/trigger/runservice', headers: { 'Authorization' => "Token #{token}" }
# success, but no source service configured :)
assert_response 403
assert_xml_tag tag: 'status', attributes: { code: 'no_permission_for_inactive' }
assert_xml_tag tag: 'status', attributes: { code: 'create_token/service_not_authorized' }
# with global token
post '/trigger/runservice?project=home:tom&package=service', headers: { 'Authorization' => "Token #{alltoken}" }
# success, but no source service configured :)
assert_response 403
assert_xml_tag tag: 'status', attributes: { code: 'no_permission_for_inactive' }
assert_xml_tag tag: 'status', attributes: { code: 'create_token/service_not_authorized' }

# reset and drop stuff as tom
tom.state = 'confirmed'
Expand Down

0 comments on commit afee6fd

Please sign in to comment.