Sha256: 4d70c65bc2401b21b057b2958205153b5aee7ba34f7333bf6ac3d3f2639461dc

Contents?: true

Size: 719 Bytes

Versions: 63

Compression:

Stored size: 719 Bytes

Contents

require "spec_helper"

module Lines

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

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

    it "is invalid without an email" do
      FactoryGirl.build(:author, email: nil).should_not be_valid
    end

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

    it "can not be deleted if belonging to one or more articles" do
      author = FactoryGirl.create(:author)
      author.articles << FactoryGirl.create(:article)
      author.destroy.should be_false
    end
  end

end

Version data entries

63 entries across 63 versions & 2 rubygems

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