aboutsummaryrefslogtreecommitdiffstats
path: root/activestorage/test/template
diff options
context:
space:
mode:
authorAidan Haran <aidanharan@yahoo.com>2017-12-09 13:41:02 +0000
committerGitHub <noreply@github.com>2017-12-09 13:41:02 +0000
commit66f34a8ea58c8c98d9cc2651d386c9e5a0789d08 (patch)
treed24e9014cf9045abc892ba97ac993e2e26e31c7e /activestorage/test/template
parent3291fa3630c456450f8c6a9b771f77c293d036cd (diff)
parent55d4cf2a9c1a6e77ed7aedb866e964039bb4a143 (diff)
downloadrails-66f34a8ea58c8c98d9cc2651d386c9e5a0789d08.tar.gz
rails-66f34a8ea58c8c98d9cc2651d386c9e5a0789d08.tar.bz2
rails-66f34a8ea58c8c98d9cc2651d386c9e5a0789d08.zip
Merge branch 'master' into custom-discarded-job-handling
Diffstat (limited to 'activestorage/test/template')
-rw-r--r--activestorage/test/template/image_tag_test.rb8
1 files changed, 7 insertions, 1 deletions
diff --git a/activestorage/test/template/image_tag_test.rb b/activestorage/test/template/image_tag_test.rb
index dedc58452e..80f183e0e3 100644
--- a/activestorage/test/template/image_tag_test.rb
+++ b/activestorage/test/template/image_tag_test.rb
@@ -7,7 +7,7 @@ class ActiveStorage::ImageTagTest < ActionView::TestCase
tests ActionView::Helpers::AssetTagHelper
setup do
- @blob = create_image_blob filename: "racecar.jpg"
+ @blob = create_file_blob filename: "racecar.jpg"
end
test "blob" do
@@ -19,6 +19,12 @@ class ActiveStorage::ImageTagTest < ActionView::TestCase
assert_dom_equal %(<img src="#{polymorphic_url variant}" />), image_tag(variant)
end
+ test "preview" do
+ blob = create_file_blob(filename: "report.pdf", content_type: "application/pdf")
+ preview = blob.preview(resize: "100x100")
+ assert_dom_equal %(<img src="#{polymorphic_url preview}" />), image_tag(preview)
+ end
+
test "attachment" do
attachment = ActiveStorage::Attachment.new(blob: @blob)
assert_dom_equal %(<img src="#{polymorphic_url attachment}" />), image_tag(attachment)