Sha256: ecaef8ae00ce2cdfe62e27022c394773e7065c163f58c29d2c72550724380ade

Contents?: true

Size: 864 Bytes

Versions: 13

Compression:

Stored size: 864 Bytes

Contents

require 'spec_helper'
require 'cloudinary'

describe Cloudinary do
  before :all do
    @user_platform = Cloudinary.user_platform
  end
  after :all do
    Cloudinary.user_platform = @user_platform
  end

  it 'should add a user platform to USER_AGENT' do
    Cloudinary.user_platform = "Spec/1.0 (Test)"
    expect(Cloudinary.USER_AGENT).to match( %r"Spec\/1.0 \(Test\) CloudinaryRuby/[\d.]+")

  end

  describe 'config' do
    before do
      @url_backup = ENV["CLOUDINARY_URL"]
    end
    after do
      ENV["CLOUDINARY_URL"] = @url_backup
      Cloudinary::config_from_url @url_backup
    end
    it "should allow nested values in CLOUDINARY_URL" do
      ENV["CLOUDINARY_URL"]  = "cloudinary://key:secret@test123?foo[bar]=value"
      Cloudinary::config_from_url ENV["CLOUDINARY_URL"]
      expect(Cloudinary::config.foo.bar).to eq 'value'
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
cloudinary-1.11.1 spec/cloudinary_spec.rb
cloudinary-1.11.0 spec/cloudinary_spec.rb
cloudinary-1.10.1.pre.rc spec/cloudinary_spec.rb
cloudinary-1.10.0 spec/cloudinary_spec.rb
cloudinary-1.9.1 spec/cloudinary_spec.rb
cloudinary-1.9.0 spec/cloudinary_spec.rb
cloudinary-1.8.3 spec/cloudinary_spec.rb
cloudinary-1.8.2 spec/cloudinary_spec.rb
cloudinary-1.8.1 spec/cloudinary_spec.rb
cloudinary-1.8.0 spec/cloudinary_spec.rb
cloudinary-1.7.0 spec/cloudinary_spec.rb
cloudinary-1.6.0 spec/cloudinary_spec.rb
cloudinary-1.5.2 spec/cloudinary_spec.rb