From da01eba0359840f7ee3924671f1399322d92c269 Mon Sep 17 00:00:00 2001 From: Sven Fuchs Date: Mon, 1 Oct 2012 15:17:18 +0200 Subject: [PATCH] fix failing specs --- Gemfile | 1 + Gemfile.lock | 11 ++++++++++- spec/endpoint/accounts_spec.rb | 2 +- spec/endpoint/artifacts_spec.rb | 2 +- spec/endpoint/users_spec.rb | 4 ++-- spec/spec_helper.rb | 1 + 6 files changed, 16 insertions(+), 5 deletions(-) diff --git a/Gemfile b/Gemfile index eb9ec209..593fa9ca 100644 --- a/Gemfile +++ b/Gemfile @@ -25,4 +25,5 @@ end group :development, :test do gem 'rake', '~> 0.9.2' gem 'micro_migrations', git: 'git://gist.github.com/2087829.git' + gem 'debugger' end diff --git a/Gemfile.lock b/Gemfile.lock index cbd4068f..6bca5d42 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -40,7 +40,7 @@ GIT GIT remote: git://github.com/travis-ci/travis-core.git - revision: a1b1e8f3e1c31c66115923938d33ac24ba866940 + revision: 60f38e45ce1d739894839ef74f405348fb5f8481 branch: sf-travis-api specs: travis-core (0.0.1) @@ -117,10 +117,18 @@ GEM backports (2.6.4) builder (3.0.3) bunny (0.8.0) + columnize (0.3.6) daemons (1.1.9) data_migrations (0.0.1) activerecord rake + debugger (1.2.0) + columnize (>= 0.3.1) + debugger-linecache (~> 1.1.1) + debugger-ruby_core_source (~> 1.1.3) + debugger-linecache (1.1.2) + debugger-ruby_core_source (>= 1.1.1) + debugger-ruby_core_source (1.1.3) diff-lcs (1.1.3) erubis (2.7.0) eventmachine (1.0.0) @@ -234,6 +242,7 @@ PLATFORMS DEPENDENCIES bunny + debugger factory_girl (~> 2.4.0) foreman gh! diff --git a/spec/endpoint/accounts_spec.rb b/spec/endpoint/accounts_spec.rb index c3eafdab..ce98ab9b 100644 --- a/spec/endpoint/accounts_spec.rb +++ b/spec/endpoint/accounts_spec.rb @@ -12,7 +12,7 @@ describe Travis::Api::App::Endpoint::Accounts do end it 'includes accounts' do - get('/accounts', access_token: access_token.to_s).should be_ok + get('/accounts', { access_token: access_token.to_s }, 'HTTP_ACCEPT' => 'application/vnd.travis-ci.2+json, */*; q=0.01').should be_ok parsed_body['accounts'].should == [{ 'id' => user.id, 'login' => user.login, diff --git a/spec/endpoint/artifacts_spec.rb b/spec/endpoint/artifacts_spec.rb index 9f251192..e2b2c8d8 100644 --- a/spec/endpoint/artifacts_spec.rb +++ b/spec/endpoint/artifacts_spec.rb @@ -6,7 +6,7 @@ describe Travis::Api::App::Endpoint::Artifacts do describe 'GET /artifacts/:id' do it 'loads the artifact' do - get("/artifacts/#{id}").should be_ok + get("/artifacts/#{id}", {}, 'HTTP_ACCEPT' => 'application/vnd.travis-ci.2+json, */*; q=0.01').should be_ok end end end diff --git a/spec/endpoint/users_spec.rb b/spec/endpoint/users_spec.rb index 6c8c7110..8520ebea 100644 --- a/spec/endpoint/users_spec.rb +++ b/spec/endpoint/users_spec.rb @@ -11,11 +11,11 @@ describe Travis::Api::App::Endpoint::Users do end it 'needs to be authenticated' do - get('/users').should_not be_ok + get('/users', {}, 'HTTP_ACCEPT' => 'application/vnd.travis-ci.2+json, */*; q=0.01').should_not be_ok end it 'replies with the current user' do - get('/users', access_token: access_token.to_s).should be_ok + get('/users', { access_token: access_token.to_s }, 'HTTP_ACCEPT' => 'application/vnd.travis-ci.2+json, */*; q=0.01').should be_ok parsed_body['user'].should == { 'id' => user.id, 'login' => user.login, diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index bc8a121e..395cde56 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -6,6 +6,7 @@ require 'sinatra/test_helpers' require 'logger' require 'gh' require 'multi_json' +require 'debugger' Travis.logger = Logger.new(StringIO.new) Travis::Api::App.setup