Commit ae3ec237 by soramugi Committed by Jon Yurek

Fast to slowly spec

```
 paperclip $ rspec spec/paperclip/integration_spec.rb --profile 1
Testing against version 4.1.7
.........................[deprecated] I18n.enforce_available_locales will default to true in the future. If you really want to skip validation of your locale you can set I18n.enforce_available_locales = false to avoid this message.
.........

Finished in 15.19 seconds (files took 0.60155 seconds to load)
34 examples, 0 failures

Top 1 slowest examples (9.54 seconds, 62.8% of total time):
  Paperclip Many models at once does not exceed the open file limit
    9.54 seconds ./spec/paperclip/integration_spec.rb:18
```

to

```
 paperclip $ rspec spec/paperclip/integration_spec.rb --profile 1
Testing against version 4.1.7
.........................[deprecated] I18n.enforce_available_locales will default to true in the future. If you really want to skip validation of your locale you can set I18n.enforce_available_locales = false to avoid this message.
.........

Finished in 10.95 seconds (files took 0.59585 seconds to load)
34 examples, 0 failures

Top 1 slowest examples (5.33 seconds, 48.7% of total time):
  Paperclip Many models at once does not exceed the open file limit
    5.33 seconds ./spec/paperclip/integration_spec.rb:18
```

at trim indent
parent 3a76abef
...@@ -48,4 +48,5 @@ Gem::Specification.new do |s| ...@@ -48,4 +48,5 @@ Gem::Specification.new do |s|
s.add_development_dependency('actionmailer', '>= 3.0.0') s.add_development_dependency('actionmailer', '>= 3.0.0')
s.add_development_dependency('generator_spec') s.add_development_dependency('generator_spec')
s.add_development_dependency('timecop') s.add_development_dependency('timecop')
s.add_development_dependency('activerecord-import')
end end
...@@ -7,9 +7,8 @@ describe 'Paperclip' do ...@@ -7,9 +7,8 @@ describe 'Paperclip' do
before do before do
rebuild_model rebuild_model
@file = File.new(fixture_file("5k.png"), 'rb') @file = File.new(fixture_file("5k.png"), 'rb')
300.times do |i| dummys = 300.times.map { |i| Dummy.new avatar: @file }
Dummy.create! avatar: @file Dummy.import dummys
end
end end
after { @file.close } after { @file.close }
......
...@@ -7,6 +7,7 @@ require 'active_support/core_ext' ...@@ -7,6 +7,7 @@ require 'active_support/core_ext'
require 'mocha/api' require 'mocha/api'
require 'bourne' require 'bourne'
require 'ostruct' require 'ostruct'
require 'activerecord-import'
ROOT = Pathname(File.expand_path(File.join(File.dirname(__FILE__), '..'))) ROOT = Pathname(File.expand_path(File.join(File.dirname(__FILE__), '..')))
......
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