Permalink
Browse files

Don't be so picky on MissingTemplate error details, this fails random…

…ly on 1.8.7 because of not ordered hash
  • Loading branch information...
1 parent 4c44f04 commit 8e5d91062f25f8c97a3bd8c6dc7dc45e38b54388 @drogus drogus committed Dec 31, 2010
Showing with 3 additions and 4 deletions.
  1. +3 −4 actionpack/test/template/lookup_context_test.rb
@@ -255,20 +255,19 @@ def setup
class TestMissingTemplate < ActiveSupport::TestCase
def setup
@lookup_context = ActionView::LookupContext.new("/Path/to/views", {})
- @details = "{:handlers=>[:erb, :rjs, :builder], :formats=>[:html, :text, :js, :css, :ics, :csv, :xml, :rss, :atom, :yaml, :multipart_form, :url_encoded_form, :json], :locale=>[:en, :en]}"
end
test "if no template was found we get a helpful error message including the inheritance chain" do
e = assert_raise ActionView::MissingTemplate do
@lookup_context.find("foo", %w(parent child))
end
- assert_equal "Missing template parent/foo, child/foo with #{@details}. Searched in:\n * \"/Path/to/views\"\n", e.message
+ assert_match %r{Missing template parent/foo, child/foo with .* Searched in:\n \* "/Path/to/views"\n}, e.message
end
-
+
test "if no partial was found we get a helpful error message including the inheritance chain" do
e = assert_raise ActionView::MissingTemplate do
@lookup_context.find("foo", %w(parent child), true)
end
- assert_equal "Missing partial parent/foo, child/foo with #{@details}. Searched in:\n * \"/Path/to/views\"\n", e.message
+ assert_match %r{Missing partial parent/foo, child/foo with .* Searched in:\n \* "/Path/to/views"\n}, e.message
end
end

0 comments on commit 8e5d910

Please sign in to comment.