Feature: Rosey Build Combinatorial
Background:
Given I have the environment variables:
| ROSEY_SOURCE | dist/site |
| ROSEY_DEST | dist/translated_site |
Scenario: Rosey builds from locales [ns, root, attr, explicit-attr]
Given I have a "dist/site/index.html" file with the content:
"""
Home header title
Home page title
Home page subtitle
Contact content
Contact title
"""
And I have a "rosey/locales/test.json" file with the content:
"""
{
"home:meta:title": "one",
"home:content:title": "two",
"home:content:subtitle": "three",
"home:content:subtitle.content": "four",
"home:content:subtitle.alt": "five",
"home:contact:contact-us": "six",
"home:contact:content-tag": "seven",
"home:contact:alt-tag": "eight",
"footer": "nine"
}
"""
When I run my program with the flags:
| build |
Then I should see a selector '[data-rosey]' in "dist/translated_site/test/index.html" with the attributes:
| data-rosey | title |
| innerText | one |
Then I should see a selector '[data-rosey]' in "dist/translated_site/test/index.html" with the attributes:
| data-rosey | title |
| innerText | two |
Then I should see a selector '[data-rosey]' in "dist/translated_site/test/index.html" with the attributes:
| data-rosey | subtitle |
| data-rosey-attrs | content,alt |
| innerText | three |
| content | four |
| alt | five |
Then I should see a selector '[data-rosey]' in "dist/translated_site/test/index.html" with the attributes:
| data-rosey | contact-us |
| innerText | six |
Then I should see a selector '[data-rosey-attrs-explicit]' in "dist/translated_site/test/index.html" with the attributes:
| data-rosey-attrs-explicit | {"content":"content-tag","alt":"alt-tag"} |
| content | seven |
| alt | eight |
| innerText | Contact title |
Then I should see a selector '[data-rosey]' in "dist/translated_site/test/index.html" with the attributes:
| data-rosey | footer |
| innerText | nine |