Sha256: 94c6d658dbaab0ca43b4e1c7f5b6fb1a592323e505d3fe55f46101150467abd1

Contents?: true

Size: 1017 Bytes

Versions: 21

Compression:

Stored size: 1017 Bytes

Contents

require "spec_helper"

module Lines

  describe Article do
    it "has a valid factory" do
      FactoryGirl.create(:article).should be_valid
    end

    it "is invalid without a title" do
      FactoryGirl.build(:article, title: nil).should_not be_valid
    end

    it "is invalid without content" do
      FactoryGirl.build(:article, content: nil).should_not be_valid
    end

    # it "is invalid with neither hero_image nor short_hero_image " do
    #   FactoryGirl.build(:article, hero_image: nil, short_hero_image: nil).should_not be_valid
    # end

    # it "is invalid with both a hero_image and a short_hero_image" do
    #   FactoryGirl.build(:article, short_hero_image: 1 ).should_not be_valid
    # end

    it "is invalid without one or more authors" do
      FactoryGirl.build(:article, author_ids: nil).should_not be_valid
    end

    it "is valid with tags" do
      a = FactoryGirl.create(:article_with_tags)
      a.should be_valid
      a.tag_list.should == ['tag1', 'tag2']
    end

  end

end

Version data entries

21 entries across 21 versions & 2 rubygems

Version Path
jeygeethanmedia-inkpen-1.2.6.2 spec/models/article_spec.rb
jeygeethanmedia-inkpen-1.2.6.1 spec/models/article_spec.rb
lines-engine-1.2.6.1 spec/models/article_spec.rb
lines-engine-1.2.6 spec/models/article_spec.rb
lines-engine-1.2.5 spec/models/article_spec.rb
lines-engine-1.2.3 spec/models/article_spec.rb
lines-engine-1.2.2 spec/models/article_spec.rb
lines-engine-1.2.1.1 spec/models/article_spec.rb
lines-engine-1.2.1 spec/models/article_spec.rb
lines-engine-1.2 spec/models/article_spec.rb
lines-engine-1.1.5.3 spec/models/article_spec.rb
lines-engine-1.1.5.2 spec/models/article_spec.rb
lines-engine-1.1.5.1 spec/models/article_spec.rb
lines-engine-1.1.5 spec/models/article_spec.rb
lines-engine-1.1.4 spec/models/article_spec.rb
lines-engine-1.1.3 spec/models/article_spec.rb
lines-engine-1.1.2 spec/models/article_spec.rb
lines-engine-1.1.1 spec/models/article_spec.rb
lines-engine-1.1.0 spec/models/article_spec.rb
lines-engine-1.0.0 spec/models/article_spec.rb