Commit fdc23a93e7368283f8f78b8e8627aef9ad73c617
1 parent
7a56075e
Exists in
master
and in
4 other branches
Style guide fixes (spacing)
Change-Id: I966bfd0ccc4b05925384ecab8c6cbe3c6ba3b667
Showing
1 changed file
with
4 additions
and
2 deletions
Show diff stats
spec/requests/api/api_helpers_spec.rb
| ... | ... | @@ -17,7 +17,6 @@ describe API do |
| 17 | 17 | env[API::APIHelpers::SUDO_HEADER] = identifier |
| 18 | 18 | end |
| 19 | 19 | |
| 20 | - | |
| 21 | 20 | def set_param(token_usr, identifier) |
| 22 | 21 | clear_env |
| 23 | 22 | clear_param |
| ... | ... | @@ -25,7 +24,6 @@ describe API do |
| 25 | 24 | params[API::APIHelpers::SUDO_PARAM] = identifier |
| 26 | 25 | end |
| 27 | 26 | |
| 28 | - | |
| 29 | 27 | def clear_env |
| 30 | 28 | env.delete(API::APIHelpers::PRIVATE_TOKEN_HEADER) |
| 31 | 29 | env.delete(API::APIHelpers::SUDO_HEADER) |
| ... | ... | @@ -70,6 +68,7 @@ describe API do |
| 70 | 68 | set_param(user, admin.username) |
| 71 | 69 | expect { current_user }.to raise_error |
| 72 | 70 | end |
| 71 | + | |
| 73 | 72 | it "should throw an error when the user cannot be found for a given id" do |
| 74 | 73 | id = user.id + admin.id |
| 75 | 74 | user.id.should_not == id |
| ... | ... | @@ -80,6 +79,7 @@ describe API do |
| 80 | 79 | set_param(admin, id) |
| 81 | 80 | expect { current_user }.to raise_error |
| 82 | 81 | end |
| 82 | + | |
| 83 | 83 | it "should throw an error when the user cannot be found for a given username" do |
| 84 | 84 | username = "#{user.username}#{admin.username}" |
| 85 | 85 | user.username.should_not == username |
| ... | ... | @@ -90,6 +90,7 @@ describe API do |
| 90 | 90 | set_param(admin, username) |
| 91 | 91 | expect { current_user }.to raise_error |
| 92 | 92 | end |
| 93 | + | |
| 93 | 94 | it "should handle sudo's to oneself" do |
| 94 | 95 | set_env(admin, admin.id) |
| 95 | 96 | current_user.should == admin |
| ... | ... | @@ -116,6 +117,7 @@ describe API do |
| 116 | 117 | current_user.should == user |
| 117 | 118 | current_user.should == user |
| 118 | 119 | end |
| 120 | + | |
| 119 | 121 | it "should handle multiple sudo's to oneself using string ids" do |
| 120 | 122 | set_env(admin, user.id.to_s) |
| 121 | 123 | current_user.should == user | ... | ... |