Methods
- S
- T
Instance Public methods
setup()
Link
test_should_return_all_templates_when_ambiguous_pattern()
Link
# File actionview/test/template/resolver_patterns_test.rb, line 23 def test_should_return_all_templates_when_ambiguous_pattern templates = @resolver.find_all("another", "custom_pattern", false, {:locale => [], :formats => [:html], :handlers => [:erb]}) assert_equal 2, templates.size, "expected two templates" assert_equal "Another template!", templates[0].source assert_equal "custom_pattern/another", templates[0].virtual_path assert_equal "Hello custom patterns!", templates[1].source assert_equal "custom_pattern/another", templates[1].virtual_path end
test_should_return_empty_list_for_unknown_path()
Link
# File actionview/test/template/resolver_patterns_test.rb, line 10 def test_should_return_empty_list_for_unknown_path templates = @resolver.find_all("unknown", "custom_pattern", false, {:locale => [], :formats => [:html], :handlers => [:erb]}) assert_equal [], templates, "expected an empty list of templates" end
test_should_return_template_for_declared_path()
Link
# File actionview/test/template/resolver_patterns_test.rb, line 15 def test_should_return_template_for_declared_path templates = @resolver.find_all("path", "custom_pattern", false, {:locale => [], :formats => [:html], :handlers => [:erb]}) assert_equal 1, templates.size, "expected one template" assert_equal "Hello custom patterns!", templates.first.source assert_equal "custom_pattern/path", templates.first.virtual_path assert_equal [:html], templates.first.formats end