Commit 89b29d92 by Prem Sichanugrist

Merge pull request #1531 from thoughtbot/ap-fix-spec

Fix intermittently failing spec
parents ed9e252d 9b2dd495
...@@ -47,4 +47,5 @@ Gem::Specification.new do |s| ...@@ -47,4 +47,5 @@ Gem::Specification.new do |s|
s.add_development_dependency('railties') s.add_development_dependency('railties')
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')
end end
require 'spec_helper' require 'spec_helper'
require 'fog' require 'fog'
require 'timecop'
describe Paperclip::Storage::Fog do describe Paperclip::Storage::Fog do
context "" do context "" do
...@@ -319,11 +320,15 @@ describe Paperclip::Storage::Fog do ...@@ -319,11 +320,15 @@ describe Paperclip::Storage::Fog do
context "generating an expiring url" do context "generating an expiring url" do
it "generates the same url when using Times and Integer offsets" do it "generates the same url when using Times and Integer offsets" do
rebuild_model(@options) Timecop.freeze do
dummy = Dummy.new offset = 1234
dummy.avatar = StringIO.new('.') rebuild_model(@options)
dummy = Dummy.new
assert_equal dummy.avatar.expiring_url(1234), dummy.avatar.expiring_url(Time.now + 1234) dummy.avatar = StringIO.new('.')
assert_equal dummy.avatar.expiring_url(offset),
dummy.avatar.expiring_url(Time.now + offset )
end
end end
it 'matches the default url if there is no assignment' do it 'matches the default url if there is no assignment' 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