carrierwave_direct 1.0.0 → 2.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,15 +0,0 @@
1
- module CarrierWaveDirect
2
- module Uploader
3
- module DirectUrl
4
-
5
- def direct_fog_url(options = {})
6
- if options[:with_path]
7
- url
8
- else
9
- CarrierWave::Storage::Fog::File.new(self, CarrierWave::Storage::Fog.new(self), nil).public_url
10
- end
11
- end
12
-
13
- end
14
- end
15
- end
@@ -1,26 +0,0 @@
1
- # encoding: utf-8
2
- #
3
- require 'spec_helper'
4
- require 'data/sample_data'
5
-
6
- describe CarrierWaveDirect::Uploader::DirectUrl do
7
-
8
- let(:subject) { DirectUploader.new }
9
-
10
- let(:mounted_subject) { DirectUploader.new(mounted_model, sample(:mounted_as)) }
11
-
12
- describe "#direct_fog_url" do
13
- it "should return the result from CarrierWave::Storage::Fog::File#public_url" do
14
- expect(subject.direct_fog_url).to eq CarrierWave::Storage::Fog::File.new(
15
- subject, nil, nil
16
- ).public_url
17
- end
18
-
19
- context ":with_path => true" do
20
- it "should return the full url set by carrierwave" do
21
- allow(subject).to receive(:url).and_return("url")
22
- expect(subject.direct_fog_url(:with_path => true)).to eq "url"
23
- end
24
- end
25
- end
26
- end