Sha256: fe502f33553c0b1453e0b47878071b18bdfe432de2d22a145ce8653d6199e9ce

Contents?: true

Size: 1.08 KB

Versions: 18

Compression:

Stored size: 1.08 KB

Contents

require 'spec_helper'

describe DocumentedItem, "klass?" do
  let!(:article) { FactoryGirl.create(:article)}
  let!(:klass_documented_item) { FactoryGirl.create(:documented_item, :documented_klass => 'Article')}
  let!(:non_klass_documented_item) { FactoryGirl.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) { FactoryGirl.create(:article)}
  let!(:content_documented_item) { FactoryGirl.create(:documented_item, :documented_content_id => article.id)}
  let!(:non_content_documented_item) { FactoryGirl.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

18 entries across 18 versions & 1 rubygems

Version Path
knitkit-3.2.0 spec/models/documented_item_spec.rb
knitkit-3.0.0 spec/models/documented_item_spec.rb
knitkit-2.1.15 spec/models/documented_item_spec.rb
knitkit-2.1.14 spec/models/documented_item_spec.rb
knitkit-2.1.13 spec/models/documented_item_spec.rb
knitkit-2.1.12 spec/models/documented_item_spec.rb
knitkit-2.1.11 spec/models/documented_item_spec.rb
knitkit-2.1.10 spec/models/documented_item_spec.rb
knitkit-2.1.9 spec/models/documented_item_spec.rb
knitkit-2.1.8 spec/models/documented_item_spec.rb
knitkit-2.1.7 spec/models/documented_item_spec.rb
knitkit-2.1.6 spec/models/documented_item_spec.rb
knitkit-2.1.5 spec/models/documented_item_spec.rb
knitkit-2.1.4 spec/models/documented_item_spec.rb
knitkit-2.1.3 spec/models/documented_item_spec.rb
knitkit-2.1.2 spec/models/documented_item_spec.rb
knitkit-2.1.1 spec/models/documented_item_spec.rb
knitkit-2.1.0 spec/models/documented_item_spec.rb