Sha256: a7d9da5a46eef2d5065e40f296735dd903b7caf591e12bdd058c782d9c2fe8a6

Contents?: true

Size: 608 Bytes

Versions: 5

Compression:

Stored size: 608 Bytes

Contents

require "spec_helper"

describe Uploadcare::Rails::File do
  before :each do
    @post = Post.new title: "Post title", file: FILE_CDN_URL 
    @file = @post.file
  end

  after :each do
    Rails.cache.delete FILE_CDN_URL
  end

  it "should be Uploadcare::Rails::File" do
    @file.should be_kind_of(Uploadcare::Rails::File)
  end

  it "should be not loaded by default" do
    @file.loaded?.should == false
  end

  it "should load itself" do
    @file.load
    @file.loaded?.should == true
  end

  it "file should respond to :cdn_url and :to_s methods" do
    @file.to_s.should == @file.cdn_url
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
uploadcare-rails-1.0.6 spec/objects/file_spec.rb
uploadcare-rails-1.0.5 spec/objects/file_spec.rb
uploadcare-rails-1.0.4 spec/objects/file_spec.rb
uploadcare-rails-1.0.3 spec/objects/file_spec.rb
uploadcare-rails-1.0.2 spec/objects/file_spec.rb