Skip to content

Commit

Permalink
Add spec for #2383
Browse files Browse the repository at this point in the history
  • Loading branch information
mshibuya committed Apr 30, 2019
1 parent 65fa873 commit a87469b
Showing 1 changed file with 15 additions and 6 deletions.
21 changes: 15 additions & 6 deletions spec/uploader/configuration_spec.rb
Expand Up @@ -133,12 +133,13 @@
uc.hoobatz = this_proc
end
end
after do
uploader_class.singleton_class.send :undef_method, :hoobatz
uploader_class.singleton_class.send :undef_method, :hoobatz=
uploader_class.send :undef_method, :hoobatz
uploader_class.send :undef_method, :hoobatz=
end

after do
uploader_class.singleton_class.send :undef_method, :hoobatz
uploader_class.singleton_class.send :undef_method, :hoobatz=
uploader_class.send :undef_method, :hoobatz
uploader_class.send :undef_method, :hoobatz=
end

context "when the proc accepts no arguments" do
let(:this_proc) { proc { "a return value" } }
Expand All @@ -157,4 +158,12 @@
end
end
end

describe '.eager_load_fog' do
before { uploader_class.fog_provider = 'fog/aws' }
it "caches Fog::Storage instance" do
expect { uploader_class.eager_load_fog(provider: 'AWS', aws_access_key_id: 'foo', aws_secret_access_key: 'bar') }.
to change { CarrierWave::Storage::Fog.connection_cache }
end
end
end

0 comments on commit a87469b

Please sign in to comment.