This repository has been archived by the owner on May 4, 2019. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
create a private url generator when the private visibility option is set
- Loading branch information
1 parent
a0f77a3
commit ea9421b
Showing
3 changed files
with
24 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
spec/lib/paperclip/storage/dropbox/generator_factor_spec.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
require "spec_helper" | ||
require "paperclip/storage/dropbox/generator_factory" | ||
|
||
describe Paperclip::Storage::Dropbox::GeneratorFactory do | ||
it "should build a private url generator" do | ||
described_class.build_url_generator(double(:storage), { | ||
dropbox_credentials: {access_type: "app_folder"}}).should be_a(Paperclip::Storage::Dropbox::PrivateUrlGenerator) | ||
end | ||
|
||
it "should build a private url generator" do | ||
described_class.build_url_generator(double(:storage), { | ||
dropbox_credentials: { access_type: "dropbox" }, | ||
dropbox_visibility: 'private'}).should be_a(Paperclip::Storage::Dropbox::PrivateUrlGenerator) | ||
end | ||
|
||
it "should build a public url generator" do | ||
described_class.build_url_generator(double(:storage), { | ||
dropbox_credentials: { access_type: "dropbox" }, | ||
dropbox_visibility: 'public'}).should be_a(Paperclip::Storage::Dropbox::PublicUrlGenerator) | ||
end | ||
end | ||
|