From 05834ad386381811d20e8338d554b1ce43ee4bbe Mon Sep 17 00:00:00 2001 From: Thomas Reynolds Date: Sun, 2 Sep 2012 10:04:43 -0700 Subject: [PATCH] Test relative_assets with i18n --- middleman-more/features/i18n_builder.feature | 21 ++++++++++++++++++- middleman-more/features/i18n_preview.feature | 19 ++++++++++++++++- .../fixtures/i18n-test-app/source/layout.erb | 9 +++++++- .../i18n-test-app/source/stylesheets/site.css | 3 +++ 4 files changed, 49 insertions(+), 3 deletions(-) create mode 100644 middleman-more/fixtures/i18n-test-app/source/stylesheets/site.css diff --git a/middleman-more/features/i18n_builder.feature b/middleman-more/features/i18n_builder.feature index 97fb5025..d60338cf 100644 --- a/middleman-more/features/i18n_builder.feature +++ b/middleman-more/features/i18n_builder.feature @@ -118,4 +118,23 @@ Feature: i18n Builder | es/index.html | | es/hola.html | And the file "index.html" should contain "Howdy" - And the file "hello.html" should contain "Hello World" \ No newline at end of file + And the file "hello.html" should contain "Hello World" + + Scenario: Running localize with relative_assets + Given a fixture app "i18n-test-app" + And a file named "config.rb" with: + """ + activate :i18n + activate :relative_assets + """ + Given a successfully built app at "i18n-test-app" + 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"' \ No newline at end of file diff --git a/middleman-more/features/i18n_preview.feature b/middleman-more/features/i18n_preview.feature index 490b454d..28be0482 100644 --- a/middleman-more/features/i18n_preview.feature +++ b/middleman-more/features/i18n_preview.feature @@ -110,4 +110,21 @@ Feature: i18n Preview When I go to "/es/index.html" Then I should see "File Not Found" When I go to "/es/hola.html" - Then I should see "File Not Found" \ No newline at end of file + Then I should see "File Not Found" + + Scenario: Running localize with relative_assets + Given a fixture app "i18n-test-app" + And a file named "config.rb" with: + """ + activate :i18n + activate :relative_assets + """ + Given the Server is running at "i18n-test-app" + When I go to "/" + Then I should see '"stylesheets/site.css"' + When I go to "/hello.html" + Then I should see '"stylesheets/site.css"' + When I go to "/es/index.html" + Then I should see '"../stylesheets/site.css"' + When I go to "/es/hola.html" + Then I should see '"../stylesheets/site.css"' \ No newline at end of file diff --git a/middleman-more/fixtures/i18n-test-app/source/layout.erb b/middleman-more/fixtures/i18n-test-app/source/layout.erb index cd9bb66d..cb465e99 100644 --- a/middleman-more/fixtures/i18n-test-app/source/layout.erb +++ b/middleman-more/fixtures/i18n-test-app/source/layout.erb @@ -1 +1,8 @@ -<%= yield %> \ No newline at end of file + + + <%= stylesheet_link_tag :site %> + + + <%= yield %> + + \ No newline at end of file diff --git a/middleman-more/fixtures/i18n-test-app/source/stylesheets/site.css b/middleman-more/fixtures/i18n-test-app/source/stylesheets/site.css new file mode 100644 index 00000000..ee28067a --- /dev/null +++ b/middleman-more/fixtures/i18n-test-app/source/stylesheets/site.css @@ -0,0 +1,3 @@ +body { + hello: world; +} \ No newline at end of file