make API specs more organized and readable

This commit is contained in:
Nihad Abbasov 2012-09-12 05:11:56 -07:00
parent a87c268f7d
commit b6f249dc1f
3 changed files with 18 additions and 12 deletions

View file

@ -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