Sha256: 04e0e53cc3a2a7392302cb79328239fa1222531e36a8412956302d1774dcc047

Contents?: true

Size: 636 Bytes

Versions: 2

Compression:

Stored size: 636 Bytes

Contents

require "rails_helper"


RSpec.describe Dorsale::Comment, type: :model do
  it { is_expected.to belong_to :author }
  it { is_expected.to validate_presence_of :author }

  it { is_expected.to belong_to :commentable }
  it { is_expected.to validate_presence_of :commentable }

  it { is_expected.to validate_presence_of :date }
  it { is_expected.to_not validate_presence_of :title }

  it "should have a valid factory" do
    expect(create(:dorsale_comment)).to be_valid
  end

  describe "default values" do
    it "should set date" do
      expect(described_class.new.date).to be_present
    end
  end # describe "default values"
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
dorsale-3.5.2 spec/models/dorsale/comment_spec.rb
dorsale-3.5.1 spec/models/dorsale/comment_spec.rb