|
1 | 1 | Feature: Edit a node
|
2 |
| - In order to show some useful information about the current node |
| 2 | + In order to edit a node |
3 | 3 | As a user that is logged into the shell
|
4 | 4 | I should be able to run a command which does that
|
5 | 5 |
|
6 | 6 | Background:
|
7 | 7 | Given that I am logged in as "testuser"
|
8 |
| - And the "session_data.xml" fixtures are loaded |
| 8 | + And the "cms.xml" fixtures are loaded |
9 | 9 |
|
10 |
| - Scenario: Show node information |
11 |
| - Given the current node is "/tests_general_base" |
12 |
| - And I execute the "node:info daniel --no-ansi" command |
| 10 | + Scenario: Make a nutral edit |
| 11 | + Given I have an editor which produces the following: |
| 12 | + """" |
| 13 | + weight: |
| 14 | + type: Long |
| 15 | + value: 10 |
| 16 | + cost: |
| 17 | + type: Double |
| 18 | + value: 12.13 |
| 19 | + size: |
| 20 | + type: String |
| 21 | + value: XL |
| 22 | + name: |
| 23 | + type: String |
| 24 | + value: 'Product One' |
| 25 | + tags: |
| 26 | + type: String |
| 27 | + value: [one, two, three] |
| 28 | + 'jcr:primaryType': |
| 29 | + type: Name |
| 30 | + value: 'nt:unstructured' |
| 31 | + """ |
| 32 | + And I execute the "node:edit cms/products/product1" command |
| 33 | + Then the command should not fail |
| 34 | + And the property "/cms/products/product1/weight" should have type "Long" and value "10" |
| 35 | + And the property "/cms/products/product1/cost" should have type "Double" and value "12.13" |
| 36 | + And the property "/cms/products/product1/size" should have type "String" and value "XL" |
| 37 | + And the property "/cms/products/product1/name" should have type "String" and value "Product One" |
| 38 | + And the property "/cms/products/product1/jcr:primaryType" should have type "Name" and value "nt:unstructured" |
| 39 | + |
| 40 | + Scenario: Remove some properties |
| 41 | + Given I have an editor which produces the following: |
| 42 | + """" |
| 43 | + weight: |
| 44 | + type: Long |
| 45 | + value: 10 |
| 46 | + name: |
| 47 | + type: String |
| 48 | + value: 'Product One' |
| 49 | + 'jcr:primaryType': |
| 50 | + type: Name |
| 51 | + value: 'nt:unstructured' |
| 52 | + """ |
| 53 | + And I execute the "node:edit cms/products/product1" command |
| 54 | + Then the command should not fail |
| 55 | + And I save the session |
| 56 | + Then the command should not fail |
| 57 | + And the property "/cms/products/product1/weight" should have type "Long" and value "10" |
| 58 | + And the property "/cms/products/product1/name" should have type "String" and value "Product One" |
| 59 | + And the property "/cms/products/product1/jcr:primaryType" should have type "Name" and value "nt:unstructured" |
| 60 | + And there should not exist a property at "/cms/products/product1/cost" |
| 61 | + And there should not exist a property at "/cms/products/product1/size" |
| 62 | + |
| 63 | + Scenario: Edit some properties |
| 64 | + Given I have an editor which produces the following: |
| 65 | + """" |
| 66 | + weight: |
| 67 | + type: Long |
| 68 | + value: 10 |
| 69 | + cost: |
| 70 | + type: Double |
| 71 | + value: 100 |
| 72 | + size: |
| 73 | + type: String |
| 74 | + value: XXL |
| 75 | + name: |
| 76 | + type: String |
| 77 | + value: 'Product One' |
| 78 | + 'jcr:primaryType': |
| 79 | + type: Name |
| 80 | + value: 'nt:unstructured' |
| 81 | + """ |
| 82 | + And I execute the "node:edit cms/products/product1" command |
| 83 | + Then the command should not fail |
| 84 | + And I save the session |
13 | 85 | Then the command should not fail
|
14 |
| - And I should see the following: |
| 86 | + And the property "/cms/products/product1/weight" should have type "Long" and value "10" |
| 87 | + And the property "/cms/products/product1/cost" should have type "Long" and value "100" |
| 88 | + And the property "/cms/products/product1/size" should have type "String" and value "XXL" |
| 89 | + And the property "/cms/products/product1/name" should have type "String" and value "Product One" |
| 90 | + And the property "/cms/products/product1/jcr:primaryType" should have type "Name" and value "nt:unstructured" |
| 91 | + |
| 92 | + Scenario: Create a new node |
| 93 | + Given I have an editor which produces the following: |
| 94 | + """" |
| 95 | + 'jcr:primaryType': |
| 96 | + type: Name |
| 97 | + value: 'nt:unstructured' |
| 98 | + foobar: |
| 99 | + type: String |
| 100 | + value: 'FOOOOOOO' |
15 | 101 | """
|
16 |
| - +-------------------+--------------------------------------+ |
17 |
| - | Path | /tests_general_base/daniel | |
18 |
| - | UUID | N/A | |
19 |
| - | Index | 1 | |
20 |
| - | Primary node type | nt:unstructured | |
21 |
| - | Mixin node types | | |
22 |
| - | Checked out? | N/A | |
23 |
| - | Locked? | [ERROR] Not implemented by jackalope | |
24 |
| - +-------------------+--------------------------------------+ |
| 102 | + And I execute the "node:edit cms/products/product2" command |
| 103 | + Then the command should not fail |
| 104 | + And I save the session |
| 105 | + Then the command should not fail |
| 106 | + And the property "/cms/products/product2/foobar" should have type "String" and value "FOOOOOOO" |
| 107 | + |
| 108 | + Scenario: Create a new node with short syntax |
| 109 | + Given I have an editor which produces the following: |
| 110 | + """" |
| 111 | + 'jcr:primaryType': |
| 112 | + type: Name |
| 113 | + value: 'nt:unstructured' |
| 114 | + foobar: FOOOOOOO |
25 | 115 | """
|
| 116 | + And I execute the "node:edit cms/products/product2" command |
| 117 | + Then the command should not fail |
| 118 | + And I save the session |
| 119 | + Then the command should not fail |
| 120 | + And the property "/cms/products/product2/foobar" should have type "String" and value "FOOOOOOO" |
26 | 121 |
|
| 122 | + Scenario: Create a new node with a specified type |
| 123 | + Given I have an editor which produces the following: |
| 124 | + """" |
| 125 | + 'jcr:primaryType': |
| 126 | + type: Name |
| 127 | + value: 'nt:resource' |
| 128 | + 'jcr:data': |
| 129 | + type: Binary |
| 130 | + value: foo |
| 131 | + """ |
| 132 | + And I execute the "node:edit cms/products/product2 --type=nt:resource" command |
| 133 | + Then the command should not fail |
| 134 | + And I save the session |
| 135 | + Then the command should not fail |
| 136 | + And there should exist a node at "/cms/products/product2" |
| 137 | + And the primary type of "/cms/products/product2" should be "nt:resource" |
0 commit comments