Merge branch 'master' of github.com:travis-ci/travis-api

This commit is contained in:
Sven Fuchs 2012-10-11 13:38:16 +02:00
commit d0cefb3830
2 changed files with 16 additions and 7 deletions

View File

@ -40,7 +40,7 @@ GIT
GIT GIT
remote: git://github.com/travis-ci/travis-core.git remote: git://github.com/travis-ci/travis-core.git
revision: 59df1c4523de303f88ca920e5e831fd91cbef8f2 revision: 1b8e433f7a1eb8cc3aaa24b3cc2e14a0176218f6
branch: sf-travis-api branch: sf-travis-api
specs: specs:
travis-core (0.0.1) travis-core (0.0.1)

View File

@ -5,12 +5,21 @@ describe 'Users' do
let(:token) { Travis::Api::App::AccessToken.create(user: user, app_id: -1) } let(:token) { Travis::Api::App::AccessToken.create(user: user, app_id: -1) }
let(:headers) { { 'HTTP_ACCEPT' => 'application/vnd.travis-ci.2+json', 'HTTP_AUTHORIZATION' => "token #{token}" } } let(:headers) { { 'HTTP_ACCEPT' => 'application/vnd.travis-ci.2+json', 'HTTP_AUTHORIZATION' => "token #{token}" } }
it 'GET /workers' do context 'PUT /users/:id' do
it 'updates user data and returns the user' do
params = {user: {id: user.id, locale: 'pl'}} params = {user: {id: user.id, locale: 'pl'}}
response = put "/users/#{user.id}", params, headers response = put "/users/#{user.id}", params, headers
response.should be_successful response.should be_successful
response.should deliver_json_for(user.reload, version: 'v2') response.should deliver_json_for(user.reload, version: 'v2')
user.locale.should == 'pl' user.locale.should == 'pl'
end end
end
context 'POST /users/sync' do
it 'syncs current_user repos' do
response = post "/users/sync", {}, headers
response.should be_successful
end
end
end end