Skip to content

Commit e4f868c

Browse files
committed
v3: request payload needs to be json encoded
1 parent 03938ca commit e4f868c

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

lib/travis/api/v3/queries/request.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ def schedule(repository, user)
1414
config: config || {}
1515
}
1616

17-
perform_async(:build_request, type: 'api'.freeze, credentials: {}, payload: payload)
17+
perform_async(:build_request, type: 'api'.freeze, credentials: {}, payload: JSON.dump(payload))
1818
payload
1919
end
2020
end

lib/travis/api/v3/query.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ def initialize(params, main_type)
3232
end
3333

3434
def perform_async(identifier, *args)
35-
class_name, queue, client = @@sidekiq_cache[identifier] ||= [
35+
class_name, queue = @@sidekiq_cache[identifier] ||= [
3636
"Travis::Sidekiq::#{identifier.to_s.camelcase}".freeze,
3737
identifier.to_s.pluralize.freeze
3838
]

spec/v3/services/requests/create_spec.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
describe Travis::API::V3::Services::Requests::Create do
44
let(:repo) { Travis::API::V3::Models::Repository.where(owner_name: 'svenfuchs', name: 'minimal').first }
5-
let(:sidekiq_payload) { Sidekiq::Client.last['args'].last[:payload] }
5+
let(:sidekiq_payload) { JSON.load(Sidekiq::Client.last['args'].last[:payload]).deep_symbolize_keys }
66
before { repo.requests.each(&:delete) }
77

88
before do
@@ -147,7 +147,7 @@
147147
user: { id: repo.owner.id },
148148
message: nil,
149149
branch: 'master',
150-
config: { 'script' => 'true' }
150+
config: { script: 'true' }
151151
}}
152152
end
153153

0 commit comments

Comments
 (0)