Merge pull request #1735 from NARKOZ/api

API fixes
This commit is contained in:
Valeriy Sizov 2012-11-07 03:50:42 -08:00
commit d6a5e3dad7
5 changed files with 17 additions and 20 deletions

View file

@ -46,7 +46,7 @@ describe Gitlab::API do
response.status.should == 201
end
it "should repsond with 404 on failure" do
it "should respond with 404 on failure" do
post api("/projects", user)
response.status.should == 404
end
@ -188,16 +188,16 @@ describe Gitlab::API do
}.to change {project.hooks.count}.by(1)
end
end
describe "PUT /projects/:id/hooks/:hook_id" do
it "should update an existing project hook" do
put api("/projects/#{project.code}/hooks/#{hook.id}", user),
url: 'http://example.com'
url: 'http://example.org'
response.status.should == 200
json_response['url'].should == 'http://example.com'
json_response['url'].should == 'http://example.org'
end
end
describe "DELETE /projects/:id/hooks" do
it "should delete hook from project" do

View file

@ -4,7 +4,7 @@ describe Gitlab::API do
include ApiHelpers
let(:user) { Factory :user }
let(:admin) {Factory :admin}
let(:admin) { Factory :admin }
let(:key) { Factory :key, user: user }
describe "GET /users" do
@ -42,9 +42,9 @@ describe Gitlab::API do
end
it "should create user" do
expect{
post api("/users", admin), Factory.attributes(:user)
}.to change{User.count}.by(1)
expect {
post api("/users", admin), Factory.attributes(:user, projects_limit: 3)
}.to change { User.count }.by(1)
end
it "shouldn't available for non admin users" do