-
Notifications
You must be signed in to change notification settings - Fork 94
Expand file tree
/
Copy pathmenu.feature
More file actions
79 lines (67 loc) · 2.05 KB
/
menu.feature
File metadata and controls
79 lines (67 loc) · 2.05 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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
Feature: Manage WordPress menus
Background:
Given a WP install
Scenario: Menu CRUD operations
When I run `wp menu create "My Menu"`
And I run `wp menu list --fields=name,slug`
Then STDOUT should be a table containing rows:
| name | slug |
| My Menu | my-menu |
When I run `wp menu delete "My Menu"`
Then STDOUT should be:
"""
Deleted menu 'My Menu'.
Success: Deleted 1 of 1 menus.
"""
And the return code should be 0
When I run `wp menu list --format=count`
Then STDOUT should be:
"""
0
"""
When I run `wp menu create "First Menu"`
And I run `wp menu create "Second Menu"`
And I run `wp menu list --fields=name,slug`
Then STDOUT should be a table containing rows:
| name | slug |
| First Menu | first-menu |
| Second Menu | second-menu |
When I run `wp menu delete "First Menu" "Second Menu"`
Then STDOUT should be:
"""
Deleted menu 'First Menu'.
Deleted menu 'Second Menu'.
Success: Deleted 2 of 2 menus.
"""
And the return code should be 0
When I run `wp menu list --format=count`
Then STDOUT should be:
"""
0
"""
When I run `wp menu create "First Menu"`
And I run `wp menu list --format=ids`
Then STDOUT should be:
"""
5
"""
Scenario: Errors when deleting menus
When I try `wp menu delete "Your menu"`
Then STDERR should be:
"""
Warning: Couldn't delete menu 'Your menu'.
Error: No menus deleted.
"""
And the return code should be 1
When I run `wp menu create "My Menu"`
And I run `wp menu list --fields=name,slug`
Then STDOUT should be a table containing rows:
| name | slug |
| My Menu | my-menu |
When I try `wp menu delete "My Menu" "Your menu"`
Then STDERR should be:
"""
Warning: Couldn't delete menu 'Your menu'.
Error: Only deleted 1 of 2 menus.
"""
And the return code should be 1