File tree Expand file tree Collapse file tree
chef-server-api/app/controllers
features/api/environments Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -60,7 +60,7 @@ def create
6060
6161 # PUT /environments/:id
6262 def update
63- raise Forbidden if params [ :id ] == "_default"
63+ raise MethodNotAllowed if params [ :id ] == "_default"
6464 begin
6565 env = Chef ::Environment . cdb_load ( params [ :id ] )
6666 rescue Chef ::Exceptions ::CouchDBNotFound
@@ -76,7 +76,7 @@ def update
7676
7777 # DELETE /environments/:id
7878 def destroy
79- raise Forbidden if params [ :id ] == "_default"
79+ raise MethodNotAllowed if params [ :id ] == "_default"
8080 begin
8181 env = Chef ::Environment . cdb_load ( params [ :id ] )
8282 rescue Chef ::Exceptions ::CouchDBNotFound
Original file line number Diff line number Diff line change @@ -30,9 +30,9 @@ Feature: Delete environments via the REST API
3030 Scenario Outline : Delete the '_default' environment
3131 Given I am <user_type>
3232 When I 'DELETE' the path '/environments/_default'
33- Then I should get a '403 "Forbidden" ' exception
33+ Then I should get a '<exception_type> ' exception
3434
3535 Examples :
36- | user_type |
37- | an administrator |
38- | a non -admin |
36+ | user_type | exception_type |
37+ | an administrator | 405 " Method Not Allowed " |
38+ | a non -admin | 403 " Forbidden " |
Original file line number Diff line number Diff line change @@ -43,9 +43,9 @@ Feature: Update an environment via the REST API
4343 Given I am <user_type>
4444 And an 'environment' named 'cucumber'
4545 When I 'PUT' the 'environment' to the path '/environments/_default'
46- Then I should get a '403 "Forbidden" ' exception
46+ Then I should get a '<exception_type> ' exception
4747
4848 Examples :
49- | user_type |
50- | an administrator |
51- | a non -admin |
49+ | user_type | exception_type |
50+ | an administrator | 405 " Method Not Allowed " |
51+ | a non -admin | 403 " Forbidden " |
You can’t perform that action at this time.
0 commit comments