2009-11-23 00:37:11 +01:00
|
|
|
Feature: Custom layouts
|
|
|
|
In order easily switch between relative and absolute paths
|
2014-06-14 21:38:44 +02:00
|
|
|
|
2009-11-23 00:37:11 +01:00
|
|
|
Scenario: Using custom :layout attribute
|
2014-06-14 21:38:44 +02:00
|
|
|
Given a fixture app "custom-layout-app2"
|
|
|
|
And a file named "config.rb" with:
|
|
|
|
"""
|
|
|
|
page '/custom-layout.html', layout: :custom
|
|
|
|
"""
|
2011-12-30 00:09:51 +01:00
|
|
|
And the Server is running at "custom-layout-app2"
|
2009-11-23 00:37:11 +01:00
|
|
|
When I go to "/custom-layout.html"
|
|
|
|
Then I should see "Custom Layout"
|
2014-06-14 21:38:44 +02:00
|
|
|
|
2016-02-24 23:20:42 +01:00
|
|
|
Scenario: Using custom :layout attribute with proxy
|
|
|
|
Given a fixture app "custom-layout-app2"
|
|
|
|
And a file named "config.rb" with:
|
|
|
|
"""
|
|
|
|
page '/test/*', layout: :custom
|
|
|
|
proxy "/test/me.html", "/custom-layout.html"
|
|
|
|
live { %w(you) }.each do |who|
|
|
|
|
proxy "/test/#{who}.html", "/custom-layout.html"
|
|
|
|
end
|
|
|
|
"""
|
|
|
|
And the Server is running at "custom-layout-app2"
|
|
|
|
When I go to "/test/me.html"
|
|
|
|
Then I should see "Custom Layout"
|
|
|
|
When I go to "/test/you.html"
|
|
|
|
Then I should see "Custom Layout"
|
|
|
|
|
2011-04-22 20:48:48 +02:00
|
|
|
Scenario: Using custom :layout attribute with folders
|
2014-06-14 21:38:44 +02:00
|
|
|
Given a fixture app "custom-layout-app2"
|
|
|
|
And a file named "config.rb" with:
|
|
|
|
"""
|
|
|
|
page '/custom-layout-dir/', layout: :custom
|
|
|
|
"""
|
2011-12-30 00:09:51 +01:00
|
|
|
And the Server is running at "custom-layout-app2"
|
2011-04-22 20:48:48 +02:00
|
|
|
When I go to "/custom-layout-dir"
|
|
|
|
Then I should see "Custom Layout"
|
|
|
|
When I go to "/custom-layout-dir/"
|
|
|
|
Then I should see "Custom Layout"
|
|
|
|
When I go to "/custom-layout-dir/index.html"
|
|
|
|
Then I should see "Custom Layout"
|
2014-06-14 21:38:44 +02:00
|
|
|
|
2011-04-22 20:48:48 +02:00
|
|
|
Scenario: Using custom :layout attribute with folders
|
2014-06-14 21:38:44 +02:00
|
|
|
Given a fixture app "custom-layout-app2"
|
|
|
|
And a file named "config.rb" with:
|
|
|
|
"""
|
|
|
|
page '/custom-layout-dir', layout: :custom
|
|
|
|
"""
|
2011-12-30 00:09:51 +01:00
|
|
|
And the Server is running at "custom-layout-app2"
|
2011-04-22 20:48:48 +02:00
|
|
|
When I go to "/custom-layout-dir"
|
|
|
|
Then I should see "Custom Layout"
|
|
|
|
When I go to "/custom-layout-dir/"
|
|
|
|
Then I should see "Custom Layout"
|
|
|
|
When I go to "/custom-layout-dir/index.html"
|
|
|
|
Then I should see "Custom Layout"
|
2014-06-14 21:38:44 +02:00
|
|
|
|
2011-04-22 20:48:48 +02:00
|
|
|
Scenario: Using custom :layout attribute with folders
|
2014-06-14 21:38:44 +02:00
|
|
|
Given a fixture app "custom-layout-app2"
|
|
|
|
And a file named "config.rb" with:
|
|
|
|
"""
|
|
|
|
page '/custom-layout-dir/index.html', layout: :custom
|
|
|
|
"""
|
2011-12-30 00:09:51 +01:00
|
|
|
And the Server is running at "custom-layout-app2"
|
2011-04-22 20:48:48 +02:00
|
|
|
When I go to "/custom-layout-dir"
|
|
|
|
Then I should see "Custom Layout"
|
|
|
|
When I go to "/custom-layout-dir/"
|
|
|
|
Then I should see "Custom Layout"
|
|
|
|
When I go to "/custom-layout-dir/index.html"
|
2012-06-17 21:03:36 +02:00
|
|
|
Then I should see "Custom Layout"
|
2014-06-14 21:38:44 +02:00
|
|
|
|
2012-06-17 21:03:36 +02:00
|
|
|
Scenario: Setting layout inside a matching page block
|
|
|
|
Given the Server is running at "page-helper-layout-block-app"
|
|
|
|
When I go to "/index.html"
|
|
|
|
Then I should see "Hello"
|
|
|
|
And I should see "World"
|
|
|
|
When I go to "/path/child.html"
|
|
|
|
Then I should see "Alt"
|
|
|
|
And I should see "Child"
|
|
|
|
And I should not see "Hello"
|
|
|
|
When I go to "/path/index.html"
|
|
|
|
Then I should see "Alt"
|
|
|
|
And I should see "Monde"
|
2016-02-24 23:20:42 +01:00
|
|
|
And I should not see "Hello"
|