aboutsummaryrefslogtreecommitdiffstats
path: root/activestorage/test/service/shared_service_tests.rb
Commit message (Collapse)AuthorAgeFilesLines
* Enable `Style/RedundantBegin` cop to avoid newly adding redundant begin blockRyuta Kamizono2018-12-211-47/+39
| | | | | | | | | | Currently we sometimes find a redundant begin block in code review (e.g. https://github.com/rails/rails/pull/33604#discussion_r209784205). I'd like to enable `Style/RedundantBegin` cop to avoid that, since rescue/else/ensure are allowed inside do/end blocks in Ruby 2.5 (https://bugs.ruby-lang.org/issues/12906), so we'd probably meets with that situation than before.
* `metadata` is not passed to serviceyuuji.yaginuma2018-12-011-2/+1
| | | | | | | | | Ref: https://github.com/rails/rails/blob/604fac6d7191fca102380b1a5f5eb9c619fb407f/activestorage/app/models/active_storage/blob.rb#L256-L264 This fixes broken `GCSServiceTest`. https://travis-ci.org/rails/rails/jobs/461868394#L6624-L6626 Follow up to #34576.
* Add a test with extra keys to active_storage Service#uploadYannick Schutz2018-11-301-0/+19
|
* Change the empty block style to have space inside of the blockRafael Mendonça França2018-09-251-1/+1
|
* Enable `Performance/UnfreezeString` copyuuji.yaginuma2018-09-231-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In Ruby 2.3 or later, `String#+@` is available and `+@` is faster than `dup`. ```ruby # frozen_string_literal: true require "bundler/inline" gemfile(true) do source "https://rubygems.org" gem "benchmark-ips" end Benchmark.ips do |x| x.report('+@') { +"" } x.report('dup') { "".dup } x.compare! end ``` ``` $ ruby -v benchmark.rb ruby 2.5.1p57 (2018-03-29 revision 63029) [x86_64-linux] Warming up -------------------------------------- +@ 282.289k i/100ms dup 187.638k i/100ms Calculating ------------------------------------- +@ 6.775M (± 3.6%) i/s - 33.875M in 5.006253s dup 3.320M (± 2.2%) i/s - 16.700M in 5.032125s Comparison: +@: 6775299.3 i/s dup: 3320400.7 i/s - 2.04x slower ```
* Translate service-specific missing object exceptions into a generic oneCameron Bothner2018-08-211-0/+21
| | | | | | | | | `ActiveStorage::Blob#download` and `ActiveStorage::Blob#open` raise `ActiveStorage::FileNotFoundError` when the corresponding file is missing from the storage service. Services translate service-specific missing object exceptions (e.g. `Google::Cloud::NotFoundError` for the GCS service and `Errno::ENOENT` for the disk service) into `ActiveStorage::FileNotFoundError`.
* Generate a new key for each service testGeorge Claghorn2018-06-251-10/+10
| | | | Sidestep Google Cloud Storage's restrictive per-object rate limit.
* Support streaming downloads from Google Cloud StorageGeorge Claghorn2018-05-011-5/+13
|
* Generate root-relative paths in Active Storage disk service URL methodsGeorge Claghorn2018-03-051-0/+5
| | | | Fixes #32129.
* Purge variants with their blobsGeorge Claghorn2017-12-021-0/+17
|
* Fix streaming downloads from S3/Azure StorageGeorge Claghorn2017-11-061-0/+10
| | | Closes #31073.
* Use frozen string literal in Active StorageKoichi ITO2017-08-121-1/+3
|
* Add 'activestorage/' from commit '3f4a7218a4a4923a0e7ce1b2eb0d2888ce30da58'Rafael Mendonça França2017-07-311-0/+67
git-subtree-dir: activestorage git-subtree-mainline: 0d58e7e478e79c2d6b2a39a4444d2a17a903b2a6 git-subtree-split: 3f4a7218a4a4923a0e7ce1b2eb0d2888ce30da58