Permalink
Browse files

Check if malformed fixture exists first

Now if somebody by mistake will remove malformed files test will raise error.
  • Loading branch information...
1 parent 08998d2 commit d6b1caa8f2011487c08b414605883f1f220d0aaa @lukaszx0 lukaszx0 committed Jun 20, 2013
Showing with 1 addition and 0 deletions.
  1. +1 −0 actionview/test/template/render_test.rb
View
1 actionview/test/template/render_test.rb
@@ -376,6 +376,7 @@ def test_render_knows_about_types_registered_when_extensions_are_checked_earlier
def test_render_ignores_templates_with_malformed_template_handlers
ActiveSupport::Deprecation.silence do
%w(malformed malformed.erb malformed.html.erb malformed.en.html.erb).each do |name|
+ assert File.exists?(File.expand_path("#{FIXTURE_LOAD_PATH}/test/malformed/#{name}~")), "Malformed file (#{name}~) which should be ignored does not exists"
assert_raises(ActionView::MissingTemplate) { @view.render(:file => "test/malformed/#{name}") }
end
end

0 comments on commit d6b1caa

Please sign in to comment.