summaryrefslogtreecommitdiff
path: root/features/api/roles/update_roles_api.feature
blob: ea72f68c05dd6f266eb439e0c35727e5e58d465a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
@api @api_roles @roles_update
Feature: Update a role
  In order to keep my role data up-to-date
  As a Developer
  I want to update my role via the API 

  Scenario Outline: Update a role 
    Given a 'registration' named 'bobo' exists
      And a 'role' named 'webserver' exists
      And sending the method '<method>' to the 'role' with '<updated_value>'
     When I 'PUT' the 'role' to the path '/roles/webserver' 
     Then the inflated response should respond to '<method>' with '<updated_value>' 
     When I 'GET' the path '/roles/webserver'
     Then the inflated response should respond to '<method>' with '<updated_value>' 

    Examples:
      | method       | updated_value    |
      | description  | gorilla          |
      | recipes      | [ "one", "two" ] |
      | default_attributes | { "a": "d" } |
      | override_attributes | { "c": "e" } |
      
  Scenario Outline: Update a role with a wrong private key
    Given a 'registration' named 'bobo' exists
      And a 'role' named 'webserver' exists
      And sending the method '<method>' to the 'role' with '<updated_value>'
     When I 'PUT' the 'role' to the path '/roles/webserver' using a wrong private key
     Then I should get a '401 "Unauthorized"' exception