Commit d7251af8 by Roderick Monje Committed by Sid Raval

Test coverage for filenames with multiple periods

2254 coverage (#2395)

* f(x): default to Paperclip::ContentTypeDetector

* fix: failures

* spec: cover consecutive periods

* fix: hound

* fix: hound
parent 0428affc
...@@ -62,7 +62,7 @@ describe Paperclip::UriAdapter do ...@@ -62,7 +62,7 @@ describe Paperclip::UriAdapter do
assert_equal 'image/png', @subject.content_type assert_equal 'image/png', @subject.content_type
end end
it 'accepts an orgiginal_filename' do it "accepts an original_filename" do
@subject.original_filename = 'image.png' @subject.original_filename = 'image.png'
assert_equal 'image.png', @subject.original_filename assert_equal 'image.png', @subject.original_filename
end end
...@@ -122,6 +122,14 @@ describe Paperclip::UriAdapter do ...@@ -122,6 +122,14 @@ describe Paperclip::UriAdapter do
it "returns a file name" do it "returns a file name" do
assert_equal file_name, @subject.original_filename assert_equal file_name, @subject.original_filename
end end
context "when file name has consecutive periods" do
let(:file_name) { "test_document..pdf" }
it "returns a file name" do
assert_equal file_name, @subject.original_filename
end
end
end end
context "a url with restricted characters in the filename" do context "a url with restricted characters in the filename" do
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment