diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/attachments_test.rb | 4 | ||||
-rw-r--r-- | test/blob_test.rb | 6 | ||||
-rw-r--r-- | test/database/setup.rb | 2 | ||||
-rw-r--r-- | test/filename_test.rb | 10 | ||||
-rw-r--r-- | test/service/configurator_test.rb | 1 | ||||
-rw-r--r-- | test/service/disk_service_test.rb | 2 | ||||
-rw-r--r-- | test/service/mirror_service_test.rb | 2 |
7 files changed, 13 insertions, 14 deletions
diff --git a/test/attachments_test.rb b/test/attachments_test.rb index ec7e9fcd5b..9b88b18247 100644 --- a/test/attachments_test.rb +++ b/test/attachments_test.rb @@ -66,7 +66,7 @@ class ActiveStorage::AttachmentsTest < ActiveSupport::TestCase test "attach new blobs" do @user.highlights.attach( - { io: StringIO.new("STUFF"), filename: "town.jpg", content_type: "image/jpg" }, + { io: StringIO.new("STUFF"), filename: "town.jpg", content_type: "image/jpg" }, { io: StringIO.new("IT"), filename: "country.jpg", content_type: "image/jpg" }) assert_equal "town.jpg", @user.highlights.first.filename.to_s @@ -76,7 +76,7 @@ class ActiveStorage::AttachmentsTest < ActiveSupport::TestCase test "purge attached blobs" do @user.highlights.attach create_blob(filename: "funky.jpg"), create_blob(filename: "wonky.jpg") highlight_keys = @user.highlights.collect(&:key) - + @user.highlights.purge assert_not @user.highlights.attached? assert_not ActiveStorage::Blob.service.exist?(highlight_keys.first) diff --git a/test/blob_test.rb b/test/blob_test.rb index cf27d59348..6a9765a859 100644 --- a/test/blob_test.rb +++ b/test/blob_test.rb @@ -13,7 +13,7 @@ class ActiveStorage::BlobTest < ActiveSupport::TestCase end test "download yields chunks" do - blob = create_blob data: 'a' * 75.kilobytes + blob = create_blob data: "a" * 75.kilobytes chunks = [] blob.download do |chunk| @@ -21,8 +21,8 @@ class ActiveStorage::BlobTest < ActiveSupport::TestCase end assert_equal 2, chunks.size - assert_equal 'a' * 64.kilobytes, chunks.first - assert_equal 'a' * 11.kilobytes, chunks.second + assert_equal "a" * 64.kilobytes, chunks.first + assert_equal "a" * 11.kilobytes, chunks.second end test "urls expiring in 5 minutes" do diff --git a/test/database/setup.rb b/test/database/setup.rb index 5921412b0c..b12038ee68 100644 --- a/test/database/setup.rb +++ b/test/database/setup.rb @@ -1,6 +1,6 @@ require "active_storage/migration" require_relative "create_users_migration" -ActiveRecord::Base.establish_connection(adapter: 'sqlite3', database: ':memory:') +ActiveRecord::Base.establish_connection(adapter: "sqlite3", database: ":memory:") ActiveStorageCreateTables.migrate(:up) ActiveStorageCreateUsers.migrate(:up) diff --git a/test/filename_test.rb b/test/filename_test.rb index 448ba7f766..e448238675 100644 --- a/test/filename_test.rb +++ b/test/filename_test.rb @@ -4,8 +4,8 @@ class ActiveStorage::FilenameTest < ActiveSupport::TestCase test "sanitize" do "%$|:;/\t\r\n\\".each_char do |character| filename = ActiveStorage::Filename.new("foo#{character}bar.pdf") - assert_equal 'foo-bar.pdf', filename.sanitized - assert_equal 'foo-bar.pdf', filename.to_s + assert_equal "foo-bar.pdf", filename.sanitized + assert_equal "foo-bar.pdf", filename.to_s end end @@ -23,14 +23,14 @@ class ActiveStorage::FilenameTest < ActiveSupport::TestCase test "strips RTL override chars used to spoof unsafe executables as docs" do # Would be displayed in Windows as "evilexe.pdf" due to the right-to-left # (RTL) override char! - assert_equal 'evil-fdp.exe', ActiveStorage::Filename.new("evil\u{202E}fdp.exe").sanitized + assert_equal "evil-fdp.exe", ActiveStorage::Filename.new("evil\u{202E}fdp.exe").sanitized end test "compare case-insensitively" do - assert_operator ActiveStorage::Filename.new('foobar.pdf'), :==, ActiveStorage::Filename.new('FooBar.PDF') + assert_operator ActiveStorage::Filename.new("foobar.pdf"), :==, ActiveStorage::Filename.new("FooBar.PDF") end test "compare sanitized" do - assert_operator ActiveStorage::Filename.new('foo-bar.pdf'), :==, ActiveStorage::Filename.new("foo\tbar.pdf") + assert_operator ActiveStorage::Filename.new("foo-bar.pdf"), :==, ActiveStorage::Filename.new("foo\tbar.pdf") end end diff --git a/test/service/configurator_test.rb b/test/service/configurator_test.rb index f8e4dccc9c..c69b8d5087 100644 --- a/test/service/configurator_test.rb +++ b/test/service/configurator_test.rb @@ -12,4 +12,3 @@ class ActiveStorage::Service::ConfiguratorTest < ActiveSupport::TestCase end end end - diff --git a/test/service/disk_service_test.rb b/test/service/disk_service_test.rb index f7752b25ef..e9a96003f1 100644 --- a/test/service/disk_service_test.rb +++ b/test/service/disk_service_test.rb @@ -7,6 +7,6 @@ class ActiveStorage::Service::DiskServiceTest < ActiveSupport::TestCase test "url generation" do assert_match /rails\/active_storage\/disk\/.*\/avatar\.png\?disposition=inline/, - @service.url(FIXTURE_KEY, expires_in: 5.minutes, disposition: :inline, filename: "avatar.png") + @service.url(FIXTURE_KEY, expires_in: 5.minutes, disposition: :inline, filename: "avatar.png") end end diff --git a/test/service/mirror_service_test.rb b/test/service/mirror_service_test.rb index 8bda01f169..3639f83d38 100644 --- a/test/service/mirror_service_test.rb +++ b/test/service/mirror_service_test.rb @@ -8,7 +8,7 @@ class ActiveStorage::Service::MirrorServiceTest < ActiveSupport::TestCase end.to_h config = mirror_config.merge \ - mirror: { service: "Mirror", primary: 'primary', mirrors: mirror_config.keys }, + mirror: { service: "Mirror", primary: "primary", mirrors: mirror_config.keys }, primary: { service: "Disk", root: Dir.mktmpdir("active_storage_tests_primary") } SERVICE = ActiveStorage::Service.configure :mirror, config |