Skip to content

Commit 4ef9ef4

Browse files
Merge pull request #1191 from travis-ci/stop-billing-request
Stop billing requests on org domain
2 parents 5fba5a4 + c9b3735 commit 4ef9ef4

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

lib/travis/api/enqueue/services/restart_model.rb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,9 @@ def accept?
3131
end
3232

3333
def billing?
34+
# there is no billing for .org
35+
return true if Travis.config.org?
36+
3437
@_billing_ok ||= begin
3538
jobs = target.is_a?(Job) ? [target] : target.matrix
3639

spec/v3/services/job/restart_spec.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,7 @@
238238
stub_request(:post, /http:\/\/localhost:9292\/(users|organizations)\/(.+)\/authorize_build/).to_return(
239239
body: MultiJson.dump(error: 'Plan not found'), status: 404
240240
)
241+
Travis.config.host = 'travis-ci.com'
241242
end
242243

243244
it 'restarts the job' do
@@ -251,6 +252,7 @@
251252
stub_request(:post, /http:\/\/localhost:9292\/(users|organizations)\/(.+)\/authorize_build/).to_return(
252253
body: MultiJson.dump(allowed: false, rejection_code: :no_build_credits), status: 403
253254
)
255+
Travis.config.host = 'travis-ci.com'
254256
end
255257

256258
it 'does not restart the job' do

0 commit comments

Comments
 (0)