diff options
author | Izaak Alpert <ialpert@blackberry.com> | 2013-09-09 13:18:10 -0400 |
---|---|---|
committer | Izaak Alpert <ialpert@blackberry.com> | 2013-09-09 13:18:10 -0400 |
commit | fdc23a93e7368283f8f78b8e8627aef9ad73c617 (patch) | |
tree | 4015e6fc973ad072c932bee80b549dd21845373e /spec | |
parent | 7a56075efac308a3bd08e022e56e96d41c4c05b5 (diff) | |
download | gitlab-ce-fdc23a93e7368283f8f78b8e8627aef9ad73c617.tar.gz |
Style guide fixes (spacing)
Change-Id: I966bfd0ccc4b05925384ecab8c6cbe3c6ba3b667
Diffstat (limited to 'spec')
-rw-r--r-- | spec/requests/api/api_helpers_spec.rb | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/spec/requests/api/api_helpers_spec.rb b/spec/requests/api/api_helpers_spec.rb index a1cbfcd60e9..2fc78a7e390 100644 --- a/spec/requests/api/api_helpers_spec.rb +++ b/spec/requests/api/api_helpers_spec.rb @@ -17,7 +17,6 @@ describe API do env[API::APIHelpers::SUDO_HEADER] = identifier end - def set_param(token_usr, identifier) clear_env clear_param @@ -25,7 +24,6 @@ describe API do params[API::APIHelpers::SUDO_PARAM] = identifier end - def clear_env env.delete(API::APIHelpers::PRIVATE_TOKEN_HEADER) env.delete(API::APIHelpers::SUDO_HEADER) @@ -70,6 +68,7 @@ describe API do set_param(user, admin.username) expect { current_user }.to raise_error end + it "should throw an error when the user cannot be found for a given id" do id = user.id + admin.id user.id.should_not == id @@ -80,6 +79,7 @@ describe API do set_param(admin, id) expect { current_user }.to raise_error end + it "should throw an error when the user cannot be found for a given username" do username = "#{user.username}#{admin.username}" user.username.should_not == username @@ -90,6 +90,7 @@ describe API do set_param(admin, username) expect { current_user }.to raise_error end + it "should handle sudo's to oneself" do set_env(admin, admin.id) current_user.should == admin @@ -116,6 +117,7 @@ describe API do current_user.should == user current_user.should == user end + it "should handle multiple sudo's to oneself using string ids" do set_env(admin, user.id.to_s) current_user.should == user |