diff options
author | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2013-01-02 21:46:06 +0400 |
---|---|---|
committer | Dmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com> | 2013-01-02 21:46:06 +0400 |
commit | ccf0686b01160e4a61bf8fb4b26f43d1486af9c2 (patch) | |
tree | 6a07765f325ad4249ba59680bc6c87b35926c9bd /spec/requests | |
parent | d431e4339269041784986da40a0e0879baaf96a9 (diff) |
Fix api specs. Use id instead path
Diffstat (limited to 'spec/requests')
-rw-r--r-- | spec/requests/api/issues_spec.rb | 10 | ||||
-rw-r--r-- | spec/requests/api/merge_requests_spec.rb | 12 | ||||
-rw-r--r-- | spec/requests/api/milestones_spec.rb | 8 |
3 files changed, 15 insertions, 15 deletions
diff --git a/spec/requests/api/issues_spec.rb b/spec/requests/api/issues_spec.rb index b44359d27d5..8f4e51f5a44 100644 --- a/spec/requests/api/issues_spec.rb +++ b/spec/requests/api/issues_spec.rb @@ -28,7 +28,7 @@ describe Gitlab::API do describe "GET /projects/:id/issues" do it "should return project issues" do - get api("/projects/#{project.path}/issues", user) + get api("/projects/#{project.id}/issues", user) response.status.should == 200 json_response.should be_an Array json_response.first['title'].should == issue.title @@ -37,7 +37,7 @@ describe Gitlab::API do describe "GET /projects/:id/issues/:issue_id" do it "should return a project issue by id" do - get api("/projects/#{project.path}/issues/#{issue.id}", user) + get api("/projects/#{project.id}/issues/#{issue.id}", user) response.status.should == 200 json_response['title'].should == issue.title end @@ -45,7 +45,7 @@ describe Gitlab::API do describe "POST /projects/:id/issues" do it "should create a new project issue" do - post api("/projects/#{project.path}/issues", user), + post api("/projects/#{project.id}/issues", user), title: 'new issue', labels: 'label, label2' response.status.should == 201 json_response['title'].should == 'new issue' @@ -56,7 +56,7 @@ describe Gitlab::API do describe "PUT /projects/:id/issues/:issue_id" do it "should update a project issue" do - put api("/projects/#{project.path}/issues/#{issue.id}", user), + put api("/projects/#{project.id}/issues/#{issue.id}", user), title: 'updated title', labels: 'label2', closed: 1 response.status.should == 200 json_response['title'].should == 'updated title' @@ -67,7 +67,7 @@ describe Gitlab::API do describe "DELETE /projects/:id/issues/:issue_id" do it "should delete a project issue" do - delete api("/projects/#{project.path}/issues/#{issue.id}", user) + delete api("/projects/#{project.id}/issues/#{issue.id}", user) response.status.should == 405 end end diff --git a/spec/requests/api/merge_requests_spec.rb b/spec/requests/api/merge_requests_spec.rb index bbaff53e5a3..f7b067070e0 100644 --- a/spec/requests/api/merge_requests_spec.rb +++ b/spec/requests/api/merge_requests_spec.rb @@ -11,14 +11,14 @@ describe Gitlab::API do describe "GET /projects/:id/merge_requests" do context "when unauthenticated" do it "should return authentication error" do - get api("/projects/#{project.path}/merge_requests") + get api("/projects/#{project.id}/merge_requests") response.status.should == 401 end end context "when authenticated" do it "should return an array of merge_requests" do - get api("/projects/#{project.path}/merge_requests", user) + get api("/projects/#{project.id}/merge_requests", user) response.status.should == 200 json_response.should be_an Array json_response.first['title'].should == merge_request.title @@ -28,7 +28,7 @@ describe Gitlab::API do describe "GET /projects/:id/merge_request/:merge_request_id" do it "should return merge_request" do - get api("/projects/#{project.path}/merge_request/#{merge_request.id}", user) + get api("/projects/#{project.id}/merge_request/#{merge_request.id}", user) response.status.should == 200 json_response['title'].should == merge_request.title end @@ -36,7 +36,7 @@ describe Gitlab::API do describe "POST /projects/:id/merge_requests" do it "should return merge_request" do - post api("/projects/#{project.path}/merge_requests", user), + post api("/projects/#{project.id}/merge_requests", user), title: 'Test merge_request', source_branch: "stable", target_branch: "master", author: user response.status.should == 201 json_response['title'].should == 'Test merge_request' @@ -45,7 +45,7 @@ describe Gitlab::API do describe "PUT /projects/:id/merge_request/:merge_request_id" do it "should return merge_request" do - put api("/projects/#{project.path}/merge_request/#{merge_request.id}", user), title: "New title" + put api("/projects/#{project.id}/merge_request/#{merge_request.id}", user), title: "New title" response.status.should == 200 json_response['title'].should == 'New title' end @@ -53,7 +53,7 @@ describe Gitlab::API do describe "POST /projects/:id/merge_request/:merge_request_id/comments" do it "should return comment" do - post api("/projects/#{project.path}/merge_request/#{merge_request.id}/comments", user), note: "My comment" + post api("/projects/#{project.id}/merge_request/#{merge_request.id}/comments", user), note: "My comment" response.status.should == 201 json_response['note'].should == 'My comment' end diff --git a/spec/requests/api/milestones_spec.rb b/spec/requests/api/milestones_spec.rb index bf42db62282..f7df90d0fdd 100644 --- a/spec/requests/api/milestones_spec.rb +++ b/spec/requests/api/milestones_spec.rb @@ -11,7 +11,7 @@ describe Gitlab::API do describe "GET /projects/:id/milestones" do it "should return project milestones" do - get api("/projects/#{project.path}/milestones", user) + get api("/projects/#{project.id}/milestones", user) response.status.should == 200 json_response.should be_an Array json_response.first['title'].should == milestone.title @@ -20,7 +20,7 @@ describe Gitlab::API do describe "GET /projects/:id/milestones/:milestone_id" do it "should return a project milestone by id" do - get api("/projects/#{project.path}/milestones/#{milestone.id}", user) + get api("/projects/#{project.id}/milestones/#{milestone.id}", user) response.status.should == 200 json_response['title'].should == milestone.title end @@ -28,7 +28,7 @@ describe Gitlab::API do describe "POST /projects/:id/milestones" do it "should create a new project milestone" do - post api("/projects/#{project.path}/milestones", user), + post api("/projects/#{project.id}/milestones", user), title: 'new milestone' response.status.should == 201 json_response['title'].should == 'new milestone' @@ -38,7 +38,7 @@ describe Gitlab::API do describe "PUT /projects/:id/milestones/:milestone_id" do it "should update a project milestone" do - put api("/projects/#{project.path}/milestones/#{milestone.id}", user), + put api("/projects/#{project.id}/milestones/#{milestone.id}", user), title: 'updated title' response.status.should == 200 json_response['title'].should == 'updated title' |