commit
6233fb6b5d
6 changed files with 68 additions and 93 deletions
|
@ -9,12 +9,14 @@ describe Gitlab::API do
|
|||
before { project.add_access(user, :read) }
|
||||
|
||||
describe "GET /issues" do
|
||||
it "should return authentication error" do
|
||||
get api("/issues")
|
||||
response.status.should == 401
|
||||
context "when unauthenticated" do
|
||||
it "should return authentication error" do
|
||||
get api("/issues")
|
||||
response.status.should == 401
|
||||
end
|
||||
end
|
||||
|
||||
describe "authenticated GET /issues" do
|
||||
context "when authenticated" do
|
||||
it "should return an array of issues" do
|
||||
get api("/issues", user)
|
||||
response.status.should == 200
|
||||
|
|
|
@ -13,12 +13,14 @@ describe Gitlab::API do
|
|||
before { project.add_access(user, :read) }
|
||||
|
||||
describe "GET /projects" do
|
||||
it "should return authentication error" do
|
||||
get api("/projects")
|
||||
response.status.should == 401
|
||||
context "when unauthenticated" do
|
||||
it "should return authentication error" do
|
||||
get api("/projects")
|
||||
response.status.should == 401
|
||||
end
|
||||
end
|
||||
|
||||
describe "authenticated GET /projects" do
|
||||
context "when authenticated" do
|
||||
it "should return an array of projects" do
|
||||
get api("/projects", user)
|
||||
response.status.should == 200
|
||||
|
|
|
@ -6,12 +6,14 @@ describe Gitlab::API do
|
|||
let(:user) { Factory :user }
|
||||
|
||||
describe "GET /users" do
|
||||
it "should return authentication error" do
|
||||
get api("/users")
|
||||
response.status.should == 401
|
||||
context "when unauthenticated" do
|
||||
it "should return authentication error" do
|
||||
get api("/users")
|
||||
response.status.should == 401
|
||||
end
|
||||
end
|
||||
|
||||
describe "authenticated GET /users" do
|
||||
context "when authenticated" do
|
||||
it "should return an array of users" do
|
||||
get api("/users", user)
|
||||
response.status.should == 200
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue