Feature: Rosey Links
Background:
Given I have the environment variables:
| ROSEY_SOURCE | dist/site |
| ROSEY_DEST | dist/translated_site |
Scenario: Rosey updates internal links
Given I have a "dist/site/index.html" file with the content:
"""
"""
And I have a "rosey/locales/blank.json" file with the content:
"""
{}
"""
When I run my program with the flags:
| build |
Then I should see a selector 'h1>a' in "dist/translated_site/blank/index.html" with the attributes:
| href | /blank/ |
| innerText | Home |
Then I should see a selector 'h2>a' in "dist/translated_site/blank/index.html" with the attributes:
| href | /blank/posts/hello-world |
| innerText | Hello World |
Then I should see a selector 'h3>a' in "dist/translated_site/blank/index.html" with the attributes:
| href | /blank/posts/hello-world/ |
| innerText | Hello World Trailing Slash |
Then I should see a selector 'h4>a' in "dist/translated_site/blank/index.html" with the attributes:
| href | /posts/hello-world.png |
| innerText | Hello World Asset |
Then I should see a selector 'h5>a' in "dist/translated_site/blank/index.html" with the attributes:
| href | posts/hello-world/ |
| innerText | Hello World Relative |
Then I should see a selector 'h6>a' in "dist/translated_site/blank/index.html" with the attributes:
| href | /blank/posts/hello-world.html |
| innerText | Hello World Extension |
Scenario: Rosey doesn't update links already pointing to a locale
Given I have a "dist/site/index.html" file with the content:
"""
"""
And I have a "rosey/locales/blank.json" file with the content:
"""
{}
"""
When I run my program with the flags:
| build |
Then I should see a selector 'h1>a' in "dist/translated_site/blank/index.html" with the attributes:
| href | /blank/blink/hello |
| innerText | Hello |
Then I should see a selector 'h2>a' in "dist/translated_site/blank/index.html" with the attributes:
| href | /blank/hello |
| innerText | Hello |