2013-02-09 08:00:29 +01:00
|
|
|
Feature: form_tag helper
|
|
|
|
|
|
|
|
Scenario: form_tag produces relative links
|
|
|
|
Given a fixture app "indexable-app"
|
|
|
|
And an empty file named "config.rb"
|
|
|
|
And a file named "source/form_tag.html.erb" with:
|
|
|
|
"""
|
2014-05-27 02:58:35 +02:00
|
|
|
absolute: <% form_tag "/needs_index.html#absolute", relative: true do %>
|
2013-02-09 08:00:29 +01:00
|
|
|
<% end %>
|
2014-05-27 02:58:35 +02:00
|
|
|
relative: <% form_tag "needs_index.html#relative", relative: true do %>
|
2013-02-09 08:00:29 +01:00
|
|
|
<% end %>
|
|
|
|
"""
|
|
|
|
And a file named "source/form_tag/sub.html.erb" with:
|
|
|
|
"""
|
2014-05-27 02:58:35 +02:00
|
|
|
absolute: <% form_tag "/needs_index.html#absolute", relative: true do %>
|
2013-02-09 08:00:29 +01:00
|
|
|
<% end %>
|
2014-05-27 02:58:35 +02:00
|
|
|
relative: <% form_tag "../needs_index.html#relative", relative: true do %>
|
2013-02-09 08:00:29 +01:00
|
|
|
<% end %>
|
|
|
|
"""
|
|
|
|
And the Server is running at "indexable-app"
|
|
|
|
When I go to "/form_tag.html"
|
|
|
|
Then I should see 'action="needs_index.html#absolute"'
|
|
|
|
Then I should see 'action="needs_index.html#relative"'
|
|
|
|
When I go to "/form_tag/sub.html"
|
|
|
|
Then I should see 'action="../needs_index.html#absolute"'
|
|
|
|
Then I should see 'action="../needs_index.html#relative"'
|