Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

API fixes #1735

Merged
merged 6 commits into from Nov 7, 2012

Conversation

Projects
None yet
2 participants
Contributor

NARKOZ commented Oct 19, 2012

No description provided.

@vsizov vsizov commented on the diff Oct 19, 2012

spec/requests/api/projects_spec.rb
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'
@vsizov

vsizov Oct 19, 2012

Contributor

what's the point?

@NARKOZ

NARKOZ Oct 19, 2012

Contributor

to test the changes.

vsizov commented on c610206 Oct 19, 2012

fix mass-assignment error in user create API

What's the error?

Why projects_limit: 3 ???

@vsizov vsizov commented on the diff Oct 19, 2012

lib/api/users.rb
# Example Request:
# POST /users
post do
authenticated_as_admin!
- attrs = attributes_for_keys [:email, :name, :password, :password_confirmation, :skype, :linkedin, :twitter, :projects_limit]
- user = User.new attrs
+ attrs = attributes_for_keys [:email, :name, :password, :skype, :linkedin, :twitter, :projects_limit]
+ user = User.new attrs, as: :admin

@vsizov vsizov commented on the diff Oct 19, 2012

lib/api/users.rb
# password (required) - Password
- # password_confirmation (required) - Password confirmation
@vsizov

vsizov Oct 19, 2012

Contributor

Good idea :)

@vsizov vsizov commented on the diff Oct 19, 2012

spec/requests/api/users_spec.rb
@@ -42,9 +42,9 @@
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)
@vsizov

vsizov Oct 19, 2012

Contributor

Why projects_limit: 3 ??
I've already commented on your fork, so one more time did it here.

vsizov added a commit that referenced this pull request Nov 7, 2012

@vsizov vsizov merged commit d6a5e3d into gitlabhq:master Nov 7, 2012

1 check passed

default The Travis build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment