Sha256: 53e87fcc30728dc97813c2410b68309e6fe8bac9dd3e81a52b49e1ff8024e749
Contents?: true
Size: 887 Bytes
Versions: 4
Compression:
Stored size: 887 Bytes
Contents
# frozen_string_literal: true require "rails_helper" module Archangel RSpec.describe Widget, 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(:content) } 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) } 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(:site) } it { expect(subject).to belong_to(:template) } end end end
Version data entries
4 entries across 4 versions & 1 rubygems