aboutsummaryrefslogtreecommitdiffstats
path: root/actionview/test/template/digestor_test.rb
diff options
context:
space:
mode:
authorDavid Heinemeier Hansson <david@loudthinking.com>2014-03-21 16:29:00 +0100
committerDavid Heinemeier Hansson <david@loudthinking.com>2014-03-21 19:38:59 +0100
commit637bb726cac60aaa1f7e482836458aa73e17fbb7 (patch)
treec10ff03433e099d7767715923446a0a4dc0aff18 /actionview/test/template/digestor_test.rb
parent4bca34750d718a6f7a9bacbe181460b4505c4ba7 (diff)
downloadrails-637bb726cac60aaa1f7e482836458aa73e17fbb7.tar.gz
rails-637bb726cac60aaa1f7e482836458aa73e17fbb7.tar.bz2
rails-637bb726cac60aaa1f7e482836458aa73e17fbb7.zip
Digestor should just rely on the finder to know about the format and the variant -- trying to pass it back in makes a mess of things (oh, and doesnt work)
Diffstat (limited to 'actionview/test/template/digestor_test.rb')
-rw-r--r--actionview/test/template/digestor_test.rb17
1 files changed, 7 insertions, 10 deletions
diff --git a/actionview/test/template/digestor_test.rb b/actionview/test/template/digestor_test.rb
index 0cbfd14c94..47e1f6a6e5 100644
--- a/actionview/test/template/digestor_test.rb
+++ b/actionview/test/template/digestor_test.rb
@@ -100,13 +100,13 @@ class TemplateDigestorTest < ActionView::TestCase
end
def test_logging_of_missing_template
- assert_logged "Couldn't find template for digesting: messages/something_missing.html" do
+ assert_logged "Couldn't find template for digesting: messages/something_missing" do
digest("messages/show")
end
end
def test_logging_of_missing_template_ending_with_number
- assert_logged "Couldn't find template for digesting: messages/something_missing_1.html" do
+ assert_logged "Couldn't find template for digesting: messages/something_missing_1" do
digest("messages/show")
end
end
@@ -207,7 +207,7 @@ class TemplateDigestorTest < ActionView::TestCase
end
def test_variants
- assert_digest_difference("messages/new", false, variant: :iphone) do
+ assert_digest_difference("messages/new", false, variants: [:iphone]) do
change_template("messages/new", :iphone)
change_template("messages/_header", :iphone)
end
@@ -261,10 +261,6 @@ class TemplateDigestorTest < ActionView::TestCase
ActionView::Resolver.caching = resolver_before
end
- def test_arguments_deprecation
- assert_deprecated(/will be removed/) { ActionView::Digestor.digest('messages/show', :html, finder) }
- assert_deprecated(/will be removed/) { ActionView::Digestor.new('messages/show', :html, finder) }
- end
private
def assert_logged(message)
@@ -294,10 +290,11 @@ class TemplateDigestorTest < ActionView::TestCase
def digest(template_name, options = {})
options = options.dup
- finder.formats = [:html]
- finder.variants = [options[:variant]] if options[:variant].present?
- ActionView::Digestor.digest({ name: template_name, format: :html, finder: finder }.merge(options))
+ finder.formats = [:html]
+ finder.variants = options.delete(:variants) || []
+
+ ActionView::Digestor.digest({ name: template_name, finder: finder }.merge(options))
end
def finder