summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2013-06-06 19:19:17 +0300
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2013-06-06 19:19:17 +0300
commit8df699a336af347628f83274b1eb11255f353e9e (patch)
tree433ba3914ada3de0f903375b5900f644f0e5395f /spec
parent543506f3c59b3c7b8d6c67b69e28466cf3b45b3a (diff)
downloadgitlab-ce-8df699a336af347628f83274b1eb11255f353e9e.tar.gz
API: project events
Diffstat (limited to 'spec')
-rw-r--r--spec/requests/api/projects_spec.rb23
1 files changed, 23 insertions, 0 deletions
diff --git a/spec/requests/api/projects_spec.rb b/spec/requests/api/projects_spec.rb
index 031b1412b0c..31075149647 100644
--- a/spec/requests/api/projects_spec.rb
+++ b/spec/requests/api/projects_spec.rb
@@ -173,6 +173,29 @@ describe API::API do
end
end
+ describe "GET /projects/:id/events" do
+ it "should return a project events" do
+ get api("/projects/#{project.id}/events", user)
+ response.status.should == 200
+ json_event = json_response.first
+
+ json_event['action_name'].should == 'joined'
+ json_event['project_id'].to_i.should == project.id
+ end
+
+ it "should return a 404 error if not found" do
+ get api("/projects/42/events", user)
+ response.status.should == 404
+ json_response['message'].should == '404 Not Found'
+ end
+
+ it "should return a 404 error if user is not a member" do
+ other_user = create(:user)
+ get api("/projects/#{project.id}/events", other_user)
+ response.status.should == 404
+ end
+ end
+
describe "GET /projects/:id/members" do
it "should return project team members" do
get api("/projects/#{project.id}/members", user)