Sha256: 5ccf60dbe7885833a40e732b16e97e44d6572e17085bd03723415cf3cc20945f

Contents?: true

Size: 767 Bytes

Versions: 4

Compression:

Stored size: 767 Bytes

Contents

# frozen_string_literal: true

require "rails_helper"

module Archangel
  RSpec.describe Template, type: :model do
    context "validations" do
      it { expect(subject).to validate_presence_of(:content) }
      it { expect(subject).to validate_presence_of(:name) }

      it { expect(subject).to allow_value(true).for(:partial) }
      it { expect(subject).to allow_value(false).for(:partial) }
      it { expect(subject).not_to allow_value(nil).for(:partial) }

      it { expect(subject).to allow_value("{{ foo }}").for(:content) }
      it { expect(subject).not_to allow_value("{{ foo }").for(:content) }
    end

    context "associations" do
      it { expect(subject).to belong_to(:parent) }
      it { expect(subject).to belong_to(:site) }
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
archangel-0.0.5 spec/models/archangel/template_spec.rb
archangel-0.0.4 spec/models/archangel/template_spec.rb
archangel-0.0.3 spec/models/archangel/template_spec.rb
archangel-0.0.2 spec/models/archangel/template_spec.rb