middleman/middleman-core/features/i18n_v3_builder.feature

165 lines
7.4 KiB
Gherkin
Raw Normal View History

2014-03-28 21:54:54 +01:00
Feature: i18n v3 Builder
2012-04-16 22:30:22 +02:00
In order to preview localized html
2013-10-29 00:42:08 +01:00
2012-04-16 22:30:22 +02:00
Scenario: Running localize with the default config
2014-03-28 21:54:54 +01:00
Given a fixture app "i18n-v3-test-app"
2012-04-16 22:30:22 +02:00
And a file named "config.rb" with:
"""
2014-03-28 21:54:54 +01:00
activate :i18n_v3
2012-04-16 22:30:22 +02:00
"""
2014-03-28 21:54:54 +01:00
Given a successfully built app at "i18n-v3-test-app"
2012-04-16 22:30:22 +02:00
When I cd to "build"
Then the following files should exist:
| index.html |
| hello.html |
| morning.html |
| one.html |
2012-04-16 22:30:22 +02:00
| es/index.html |
| es/hola.html |
| es/manana.html |
| es/una.html |
| CNAME |
| password.txt |
2012-04-16 22:30:22 +02:00
Then the following files should not exist:
| en/index.html |
2013-10-29 00:42:08 +01:00
| en/manana.html |
| en/hola.html |
| en/una.html |
| es/morning.html |
| es/one.html |
| es/hello.html |
| en/morning.en.html |
| en/morning.es.html |
| morning.en.html |
| morning.es.html |
| defaults_en/index.html |
| en_defaults/index.html |
2013-10-29 00:42:08 +01:00
And the file "index.html" should contain "Howdy"
2012-04-16 22:30:22 +02:00
And the file "hello.html" should contain "Hello World"
And the file "morning.html" should contain "Good morning"
And the file "one.html" should contain "Only one"
2012-04-16 22:30:22 +02:00
And the file "es/index.html" should contain "Como Esta?"
And the file "es/hola.html" should contain "Hola World"
And the file "es/manana.html" should contain "Buenos días"
And the file "es/una.html" should contain "Solamente una"
And the file "CNAME" should contain "test.github.com"
And the file "password.txt" should contain "hunter2"
2013-10-29 00:42:08 +01:00
2012-04-16 22:30:22 +02:00
Scenario: Running localize with the alt path config
2014-03-28 21:54:54 +01:00
Given a fixture app "i18n-v3-test-app"
2012-04-16 22:30:22 +02:00
And a file named "config.rb" with:
"""
2014-03-28 21:54:54 +01:00
activate :i18n_v3, :path => "/lang_:locale/"
2012-04-16 22:30:22 +02:00
"""
2014-03-28 21:54:54 +01:00
Given a successfully built app at "i18n-v3-test-app"
2012-04-16 22:30:22 +02:00
When I cd to "build"
Then the following files should exist:
| index.html |
| hello.html |
| lang_es/index.html |
| lang_es/hola.html |
Then the following files should not exist:
| lang_en/index.html |
2013-10-29 00:42:08 +01:00
And the file "index.html" should contain "Howdy"
2012-04-16 22:30:22 +02:00
And the file "hello.html" should contain "Hello World"
And the file "lang_es/index.html" should contain "Como Esta?"
And the file "lang_es/hola.html" should contain "Hola World"
2013-10-29 00:42:08 +01:00
2012-04-16 22:30:22 +02:00
Scenario: Running localize with the alt root config
2014-03-28 21:54:54 +01:00
Given a fixture app "i18n-v3-alt-root-app"
2012-04-16 22:30:22 +02:00
And a file named "config.rb" with:
"""
2014-03-28 21:54:54 +01:00
activate :i18n_v3, :templates_dir => "lang_data"
2012-04-16 22:30:22 +02:00
"""
2014-03-28 21:54:54 +01:00
Given a successfully built app at "i18n-v3-alt-root-app"
2012-04-16 22:30:22 +02:00
When I cd to "build"
Then the following files should exist:
| index.html |
| hello.html |
| es/index.html |
| es/hola.html |
Then the following files should not exist:
| en/index.html |
2013-10-29 00:42:08 +01:00
And the file "index.html" should contain "Howdy"
2012-04-16 22:30:22 +02:00
And the file "hello.html" should contain "Hello World"
And the file "es/index.html" should contain "Como Esta?"
And the file "es/hola.html" should contain "Hola World"
2013-10-29 00:42:08 +01:00
2012-04-16 22:30:22 +02:00
Scenario: Running localize with the lang map config
2014-03-28 21:54:54 +01:00
Given a fixture app "i18n-v3-test-app"
2012-04-16 22:30:22 +02:00
And a file named "config.rb" with:
"""
2014-03-28 21:54:54 +01:00
activate :i18n_v3, :lang_map => { :en => :english, :es => :spanish }
2012-04-16 22:30:22 +02:00
"""
2014-03-28 21:54:54 +01:00
Given a successfully built app at "i18n-v3-test-app"
2012-04-16 22:30:22 +02:00
When I cd to "build"
Then the following files should exist:
| index.html |
| hello.html |
| spanish/index.html |
| spanish/hola.html |
Then the following files should not exist:
| english/index.html |
2013-10-29 00:42:08 +01:00
And the file "index.html" should contain "Howdy"
2012-04-16 22:30:22 +02:00
And the file "hello.html" should contain "Hello World"
And the file "spanish/index.html" should contain "Como Esta?"
And the file "spanish/hola.html" should contain "Hola World"
2013-10-29 00:42:08 +01:00
2012-04-16 22:30:22 +02:00
Scenario: Running localize with the no mount config
2014-03-28 21:54:54 +01:00
Given a fixture app "i18n-v3-test-app"
2012-04-16 22:30:22 +02:00
And a file named "config.rb" with:
"""
2014-03-28 21:54:54 +01:00
activate :i18n_v3, :mount_at_root => false
2012-04-16 22:30:22 +02:00
"""
2014-03-28 21:54:54 +01:00
Given a successfully built app at "i18n-v3-test-app"
2012-04-16 22:30:22 +02:00
When I cd to "build"
Then the following files should exist:
| en/index.html |
| en/hello.html |
| es/index.html |
| es/hola.html |
Then the following files should not exist:
| index.html |
| hello.html |
2013-10-29 00:42:08 +01:00
And the file "en/index.html" should contain "Howdy"
2012-04-16 22:30:22 +02:00
And the file "en/hello.html" should contain "Hello World"
And the file "es/index.html" should contain "Como Esta?"
And the file "es/hola.html" should contain "Hola World"
2013-10-29 00:42:08 +01:00
2012-04-16 22:30:22 +02:00
Scenario: Running localize with the subset config
2014-03-28 21:54:54 +01:00
Given a fixture app "i18n-v3-test-app"
2012-04-16 22:30:22 +02:00
And a file named "config.rb" with:
"""
2014-03-28 21:54:54 +01:00
activate :i18n_v3, :langs => [:en]
2012-04-16 22:30:22 +02:00
"""
2014-03-28 21:54:54 +01:00
Given a successfully built app at "i18n-v3-test-app"
2012-04-16 22:30:22 +02:00
When I cd to "build"
Then the following files should exist:
| index.html |
| hello.html |
Then the following files should not exist:
| en/index.html |
| es/index.html |
| es/hola.html |
2013-10-29 00:42:08 +01:00
And the file "index.html" should contain "Howdy"
2012-09-02 19:04:43 +02:00
And the file "hello.html" should contain "Hello World"
2013-10-29 00:42:08 +01:00
2012-09-02 19:04:43 +02:00
Scenario: Running localize with relative_assets
2014-03-28 21:54:54 +01:00
Given a fixture app "i18n-v3-test-app"
2012-09-02 19:04:43 +02:00
And a file named "config.rb" with:
"""
2014-03-28 21:54:54 +01:00
activate :i18n_v3
2012-09-02 19:04:43 +02:00
activate :relative_assets
"""
2014-03-28 21:54:54 +01:00
Given a successfully built app at "i18n-v3-test-app"
2012-09-02 19:04:43 +02:00
When I cd to "build"
Then the following files should exist:
| index.html |
| hello.html |
| es/index.html |
| es/hola.html |
And the file "index.html" should contain '"stylesheets/site.css"'
And the file "hello.html" should contain '"stylesheets/site.css"'
And the file "es/index.html" should contain '"../stylesheets/site.css"'
And the file "es/hola.html" should contain '"../stylesheets/site.css"'