add .rspec for formatting, add new test (still broken)

This commit is contained in:
carlad 2016-03-31 17:15:43 +02:00
parent f51cf1a1d1
commit 24b2abdfd0
2 changed files with 24 additions and 0 deletions

3
.rspec Normal file
View File

@ -0,0 +1,3 @@
--colour
--tty
--format documentation

View File

@ -239,6 +239,27 @@ describe Travis::API::V3::Services::Requests::Create do
}
end
describe "overrides default request limit if included in repository.settings" do
let(:repository) { Travis::API::V3::Models::Repository.create(owner_name: 'svenfuchs', name: 'minimal', settings: { "api_builds_rate_limit" => "11" } )}
before { 10.times { repository.requests.create(event_type: 'api', result: 'accepted') } }
before { post("/v3/repo/#{repository.id}/requests", params, headers) }
example { expect(last_response.status).to be == 200 }
example { expect(JSON.load(body).to_s).to include(
"@type",
"error",
"error_type",
"request_limit_reached",
"error_message",
"request limit reached for resource",
"repository",
"representation",
"minimal",
"slug",
"svenfuchs/minimal")
}
end
describe "passing the token in params" do
let(:params) {{ request: { token: 'foo-bar' }}}
example { expect(sidekiq_params[:credentials]).to be == {