|
140 | 140 | ] |
141 | 141 | }, |
142 | 142 | description: 'requirements contain setting placeholder in nested trigger action' |
| 143 | + }, |
| 144 | + { |
| 145 | + error: :setting_placeholders_not_allowed_in_cov2_requirements, |
| 146 | + requirements: { |
| 147 | + 'objects' => [ |
| 148 | + { 'key' => 'object_1', 'title' => '{{setting.value}}', 'title_pluralized' => 'Objects 1', |
| 149 | + 'include_in_list_view' => true } |
| 150 | + ] |
| 151 | + }, |
| 152 | + description: 'requirements contain setting placeholder without spaces' |
| 153 | + }, |
| 154 | + { |
| 155 | + error: :setting_placeholders_not_allowed_in_cov2_requirements, |
| 156 | + requirements: { |
| 157 | + 'objects' => [ |
| 158 | + { 'key' => 'object_1', 'title' => '{{ setting.value }}', 'title_pluralized' => 'Objects 1', |
| 159 | + 'include_in_list_view' => true } |
| 160 | + ] |
| 161 | + }, |
| 162 | + description: 'requirements contain setting placeholder with extra whitespace' |
| 163 | + }, |
| 164 | + { |
| 165 | + error: :setting_placeholders_not_allowed_in_cov2_requirements, |
| 166 | + requirements: { |
| 167 | + 'objects' => [ |
| 168 | + { 'key' => 'object_1', 'title' => '{{ setting.my-value }}', 'title_pluralized' => 'Objects 1', |
| 169 | + 'include_in_list_view' => true } |
| 170 | + ] |
| 171 | + }, |
| 172 | + description: 'requirements contain setting placeholder with hyphen in property name' |
| 173 | + }, |
| 174 | + { |
| 175 | + error: :setting_placeholders_not_allowed_in_cov2_requirements, |
| 176 | + requirements: { |
| 177 | + 'objects' => [ |
| 178 | + { 'key' => 'object_1', 'title' => '{{ setting.my_value }}', 'title_pluralized' => 'Objects 1', |
| 179 | + 'include_in_list_view' => true } |
| 180 | + ] |
| 181 | + }, |
| 182 | + description: 'requirements contain setting placeholder with underscore in property name' |
| 183 | + }, |
| 184 | + { |
| 185 | + error: :setting_placeholders_not_allowed_in_cov2_requirements, |
| 186 | + requirements: { |
| 187 | + 'objects' => [ |
| 188 | + { 'key' => 'object_1', 'title' => '{{ setting.nested.value }}', 'title_pluralized' => 'Objects 1', |
| 189 | + 'include_in_list_view' => true } |
| 190 | + ] |
| 191 | + }, |
| 192 | + description: 'requirements contain setting placeholder with dot in property name' |
143 | 193 | } |
144 | 194 | ].each do |test_case| |
145 | 195 | context "when #{test_case[:description]}" do |
|
198 | 248 | ] |
199 | 249 | }, |
200 | 250 | description: 'requirements contain "setting" without property (should not match)' |
| 251 | + }, |
| 252 | + { |
| 253 | + requirements: { |
| 254 | + 'objects' => [ |
| 255 | + { 'key' => 'object_1', 'title' => '{{setting}}', 'title_pluralized' => 'Objects 1', |
| 256 | + 'include_in_list_view' => true } |
| 257 | + ] |
| 258 | + }, |
| 259 | + description: 'requirements contain "setting" without property and no spaces (should not match)' |
| 260 | + }, |
| 261 | + { |
| 262 | + requirements: { |
| 263 | + 'objects' => [ |
| 264 | + { 'key' => 'object_1', 'title' => '{{ setting. }}', 'title_pluralized' => 'Objects 1', |
| 265 | + 'include_in_list_view' => true } |
| 266 | + ] |
| 267 | + }, |
| 268 | + description: 'requirements contain "setting" with dot but no property name (should not match)' |
201 | 269 | } |
202 | 270 | ].each do |test_case| |
203 | 271 | context "when #{test_case[:description]}" do |
|
0 commit comments