Sha256: 25d97fb97d303c76b25485b61d1e883f6778ab305f89eedc46e8f168ee5f00db

Contents?: true

Size: 1.06 KB

Versions: 10

Compression:

Stored size: 1.06 KB

Contents

require 'spec_helper'

describe DocumentedItem, "klass?" do
  let!(:article) { Factory.create(:article)}
  let!(:klass_documented_item) { Factory.create(:documented_item, :documented_klass => 'Article')}
  let!(:non_klass_documented_item) { Factory.create(:documented_item, :documented_content_id => article.id)}
  
  it "should return true if klass isn't nil" do
    klass_documented_item.klass?.should be_true
  end
  
  it "should return false if klass is nil" do
    non_klass_documented_item.klass?.should be_false
  end
end

describe DocumentedItem, "content?" do
  let!(:article) { Factory.create(:article)}
  let!(:content_documented_item) { Factory.create(:documented_item, :documented_content_id => article.id)}
  let!(:non_content_documented_item) { Factory.create(:documented_item, :documented_klass => 'Article')}
  
  it "should return true if documented_content_id isn't nil" do
    content_documented_item.content?.should be_true
  end
  
  it "should return false if documented_content_id is nil" do
    non_content_documented_item.content?.should be_false
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
knitkit-2.0.11 spec/models/documented_item_spec.rb
knitkit-2.0.10 spec/models/documented_item_spec.rb
knitkit-2.0.9 spec/models/documented_item_spec.rb
knitkit-2.0.7 spec/models/documented_item_spec.rb
knitkit-2.0.6 spec/models/documented_item_spec.rb
knitkit-2.0.5 spec/models/documented_item_spec.rb
knitkit-2.0.4 spec/models/documented_item_spec.rb
knitkit-2.0.3 spec/models/documented_item_spec.rb
knitkit-2.0.2 spec/models/documented_item_spec.rb
knitkit-2.0.1 spec/models/documented_item_spec.rb