Commit 5d8a99f10429168e6471fdd1843f5045a10a84b3

Authored by Sebastian Ziebell
1 parent a534c9b7

Test to check a user must be part of the team to see project.

A user must be part of the team to see a protected project. A test is given
to check that a 404 error is returned if the user can not see the project.
Showing 1 changed file with 6 additions and 0 deletions   Show diff stats
spec/requests/api/projects_spec.rb
@@ -89,6 +89,12 @@ describe Gitlab::API do @@ -89,6 +89,12 @@ describe Gitlab::API do
89 response.status.should == 404 89 response.status.should == 404
90 json_response['message'].should == '404 Not Found' 90 json_response['message'].should == '404 Not Found'
91 end 91 end
  92 +
  93 + it "should return a 404 error if user is not a member" do
  94 + other_user = create(:user)
  95 + get api("/projects/#{project.id}", other_user)
  96 + response.status.should == 404
  97 + end
92 end 98 end
93 99
94 describe "GET /projects/:id/repository/branches" do 100 describe "GET /projects/:id/repository/branches" do