Sha256: 70d4c17d2e6b25236a2f22f5cf6732e7c3a8bb16ea44ab2b7f79adf6d9561694

Contents?: true

Size: 686 Bytes

Versions: 3

Compression:

Stored size: 686 Bytes

Contents

require "spec_helper"

describe Chillfile::Model::SyncFile do
  include DbHelper
  
  before(:each) do
    reset_db!
  end
  
  it "should be possible create a file" do
    Chillfile::Model::SyncFile.new(:paths => ["./foo/bar.baz"], :checksum => "13123f6casdd03480be5f781ee12312asdasd232").save.persisted?.should be_true
  end
  
  it "should be possible to find using a checksum" do
    Chillfile::Model::SyncFile.new(:paths => ["./foo/bar.baz", "./woo_lands"], :checksum => "13123f6casdd03480be5f781ee12312asdasd232").save
    Chillfile::Model::SyncFile.by_checksum(:key => "13123f6casdd03480be5f781ee12312asdasd232").first[:paths].should == ["./foo/bar.baz", "./woo_lands"]
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
chillfile-0.0.3 spec/lib/chillfile/model/sync_file_spec.rb
chillfile-0.0.2 spec/lib/chillfile/model/sync_file_spec.rb
chillfile-0.0.1 spec/lib/chillfile/model/sync_file_spec.rb