Repository navigation
Expand file tree
/
Copy pathmenu-location.feature
More file actions
58 lines (49 loc) · 1.88 KB
/
Copy pathmenu-location.feature
File metadata and controls
58 lines (49 loc) · 1.88 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
Feature: Manage WordPress menu locations
Background:
Given a WP install
And I run `wp theme delete --all --force`
And I run `wp theme install twentytwelve --activate`
Scenario: Assign / remove location from a menu
When I run `wp menu location list`
Then STDOUT should be a table containing rows:
| location | description |
| primary | Primary Menu |
When I run `wp menu create "Primary Menu"`
And I run `wp menu location assign primary-menu primary`
And I run `wp menu list --fields=slug,locations`
Then STDOUT should be a table containing rows:
| slug | locations |
| primary-menu | primary |
When I run `wp menu location list --format=ids`
Then STDOUT should be:
"""
primary
"""
When I run `wp menu location remove primary-menu primary`
And I run `wp menu list --fields=slug,locations`
Then STDOUT should be a table containing rows:
| slug | locations |
| primary-menu | |
When I try `wp menu location assign secondary-menu secondary`
Then STDERR should be:
"""
Error: Invalid menu secondary-menu.
"""
And the return code should be 1
When I run `wp menu create "Secondary Menu"`
And I try `wp menu location assign secondary-menu secondary`
Then STDERR should be:
"""
Error: Invalid location secondary.
"""
And the return code should be 1
When I run `wp menu location assign secondary-menu primary`
Then STDOUT should be:
"""
Success: Assigned location primary to menu secondary-menu.
"""
When I run `wp menu list --fields=slug,locations`
Then STDOUT should be a table containing rows:
| slug | locations |
| primary-menu | |
| secondary-menu | primary |