Repository navigation
Expand file tree
/
Copy pathshow_data_bag_api.feature
More file actions
44 lines (37 loc) · 1.67 KB
/
Copy pathshow_data_bag_api.feature
File metadata and controls
44 lines (37 loc) · 1.67 KB
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
@api @data @api_data
Feature: Show a data_bag via the REST API
In order to know what the details are for a data_bag
As a Developer
I want to show the details for a specific data_bag
Scenario: Show a data_bag with no entries in it
Given a 'registration' named 'bobo' exists
And a 'data_bag' named 'users' exists
When I authenticate as 'bobo'
And I 'GET' the path '/data/users'
Then the inflated response should be an empty array
Scenario: Show a data_bag with one entry in it
Given a 'registration' named 'bobo' exists
And a 'data_bag' named 'users' exists
And a 'data_bag_item' named 'francis' exists
When I authenticate as 'bobo'
And I 'GET' the path '/data/users'
Then the inflated response should include '/data/users/francis'
Scenario: Show a data_bag with two entries in it
Given a 'registration' named 'bobo' exists
And a 'data_bag' named 'users' exists
And a 'data_bag_item' named 'francis' exists
And a 'data_bag_item' named 'axl_rose' exists
When I authenticate as 'bobo'
And I 'GET' the path '/data/users'
Then the inflated response should include '/data/users/francis'
And the inflated response should include '/data/users/axl_rose'
Scenario: Show a missing data_bag
Given a 'registration' named 'bobo' exists
And there are no data_bags
When I authenticate as 'bobo'
And I 'GET' the path '/data/users'
Then I should get a '404 "Not Found"' exception
Scenario: Show a data_bag without authenticating
Given a 'data_bag' named 'users' exists
And I 'GET' the path '/data/users'
Then I should get a '401 "Unauthorized"' exception