Skip to content
Snippets Groups Projects

API fixes

Merged gitlab-qa-bot requested to merge github/fork/NARKOZ/api into master

Created by: NARKOZ

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
188 188 }.to change {project.hooks.count}.by(1)
189 189 end
190 190 end
191
191
192 192 describe "PUT /projects/:id/hooks/:hook_id" do
193 193 it "should update an existing project hook" do
194 194 put api("/projects/#{project.code}/hooks/#{hook.id}", user),
195 url: 'http://example.com'
195 url: 'http://example.org'
  • Created by: vsizov

    what's the point?

    By Administrator on 2012-10-19T13:57:04 (imported from GitLab project)

    By Administrator on 2012-10-19T13:57:04 (imported from GitLab)

  • gitlab-qa-bot
  • 32 31 # password (required) - Password
    33 # password_confirmation (required) - Password confirmation
    32 # name - Name
    34 33 # skype - Skype ID
    35 34 # linkedin - Linkedin
    36 35 # twitter - Twitter account
    37 # projects_limit - Limit projects wich user can create
    36 # projects_limit - Number of projects user can create
    38 37 # Example Request:
    39 38 # POST /users
    40 39 post do
    41 40 authenticated_as_admin!
    42 attrs = attributes_for_keys [:email, :name, :password, :password_confirmation, :skype, :linkedin, :twitter, :projects_limit]
    43 user = User.new attrs
    41 attrs = attributes_for_keys [:email, :name, :password, :skype, :linkedin, :twitter, :projects_limit]
    42 user = User.new attrs, as: :admin
    • Created by: vsizov

      Why as :admin ?

      By Administrator on 2012-10-19T14:02:04 (imported from GitLab project)

      By Administrator on 2012-10-19T14:02:04 (imported from GitLab)

  • gitlab-qa-bot
  • 23 23 @user = User.find(params[:id])
    24 24 present @user, with: Entities::User
    25 25 end
    26
    26
    27 27 # Create user. Available only for admin
    28 28 #
    29 29 # Parameters:
    30 30 # email (required) - Email
    31 # name (required) - Name
    32 31 # password (required) - Password
    33 # password_confirmation (required) - Password confirmation
    • Created by: vsizov

      Good idea :)

      By Administrator on 2012-10-19T14:02:28 (imported from GitLab project)

      By Administrator on 2012-10-19T14:02:28 (imported from GitLab)

  • gitlab-qa-bot
  • 42 42 end
    43 43
    44 44 it "should create user" do
    45 expect{
    46 post api("/users", admin), Factory.attributes(:user)
    47 }.to change{User.count}.by(1)
    45 expect {
    46 post api("/users", admin), Factory.attributes(:user, projects_limit: 3)
    • Created by: vsizov

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

      By Administrator on 2012-10-19T14:05:19 (imported from GitLab project)

      By Administrator on 2012-10-19T14:05:19 (imported from GitLab)

  • gitlab-qa-bot
  • 32 31 # password (required) - Password
    33 # password_confirmation (required) - Password confirmation
    32 # name - Name
    34 33 # skype - Skype ID
    35 34 # linkedin - Linkedin
    36 35 # twitter - Twitter account
    37 # projects_limit - Limit projects wich user can create
    36 # projects_limit - Number of projects user can create
    38 37 # Example Request:
    39 38 # POST /users
    40 39 post do
    41 40 authenticated_as_admin!
    42 attrs = attributes_for_keys [:email, :name, :password, :password_confirmation, :skype, :linkedin, :twitter, :projects_limit]
    43 user = User.new attrs
    41 attrs = attributes_for_keys [:email, :name, :password, :skype, :linkedin, :twitter, :projects_limit]
    42 user = User.new attrs, as: :admin
  • gitlab-qa-bot
  • 188 188 }.to change {project.hooks.count}.by(1)
    189 189 end
    190 190 end
    191
    191
    192 192 describe "PUT /projects/:id/hooks/:hook_id" do
    193 193 it "should update an existing project hook" do
    194 194 put api("/projects/#{project.code}/hooks/#{hook.id}", user),
    195 url: 'http://example.com'
    195 url: 'http://example.org'
    • Created by: NARKOZ

      to test the changes.

      By Administrator on 2012-10-19T15:01:46 (imported from GitLab project)

      By Administrator on 2012-10-19T15:01:46 (imported from GitLab)

    Please register or sign in to reply
    Loading