Sha256: 095e50605f6876574f687cc702af5ac795947b29ce50afa2009b17999af52086

Contents?: true

Size: 683 Bytes

Versions: 4

Compression:

Stored size: 683 Bytes

Contents

# frozen_string_literal: true

require "rails_helper"

module Archangel
  RSpec.describe Collection, type: :model do
    context "callbacks" do
      it { expect(subject).to callback(:parameterize_slug).before(:validation) }

      it { expect(subject).to callback(:column_reset).after(:destroy) }
    end

    context "validations" do
      it { expect(subject).to validate_presence_of(:name) }
      it { expect(subject).to validate_presence_of(:slug) }

      it { expect(subject).to have_db_index(:slug).unique(true) }
    end

    context "associations" do
      it { expect(subject).to have_many(:entries) }
      it { expect(subject).to have_many(:fields) }
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

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