Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Modify assert_template to use notifications. Also, remove ActionContr…
…oller::Base#template since it is no longer needed.
- Loading branch information
Carlhuda
committed
Mar 17, 2010
1 parent
7872fa9
commit d9375f3
Showing
15 changed files
with
104 additions
and
79 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
require "abstract_unit" | ||
require "template/erb/helper" | ||
|
||
module ERBTest | ||
class TagHelperTest < BlockTestCase | ||
test "form_for works" do | ||
output = render_content "form_for(:staticpage, :url => {:controller => 'blah', :action => 'update'})", "" | ||
assert_equal "<form action=\"/blah/update\" method=\"post\"></form>", output | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
module ERBTest | ||
class ViewContext | ||
mock_controller = Class.new do | ||
include SharedTestRoutes.url_helpers | ||
end | ||
|
||
include ActionView::Helpers::TagHelper | ||
include ActionView::Helpers::JavaScriptHelper | ||
include ActionView::Helpers::FormHelper | ||
|
||
attr_accessor :output_buffer | ||
|
||
def protect_against_forgery?() false end | ||
|
||
define_method(:controller) do | ||
mock_controller.new | ||
end | ||
end | ||
|
||
class BlockTestCase < ActiveSupport::TestCase | ||
def render_content(start, inside) | ||
template = block_helper(start, inside) | ||
ActionView::Template::Handlers::Erubis.new(template).evaluate(ViewContext.new) | ||
end | ||
|
||
def block_helper(str, rest) | ||
"<%= #{str} do %>#{rest}<% end %>" | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.