Sha256: 36f4135b5ce0938cdedc4544122b9d684f0bae90e259b461c1bb275d21a22411

Contents?: true

Size: 731 Bytes

Versions: 23

Compression:

Stored size: 731 Bytes

Contents

require 'spec_helper'

module Naf
  describe LoggerName do
    # Mass-assignment
    [:name].each do |a|
      it { should allow_mass_assignment_of(a) }
    end

    [:id,
     :created_at,
     :updated_at].each do |a|
      it { should_not allow_mass_assignment_of(a) }
    end

    #---------------------
    # *** Associations ***
    #+++++++++++++++++++++

    it { should have_many(:logger_style_names) }
    it { should have_many(:logger_styles) }

    #--------------------
    # *** Validations ***
    #++++++++++++++++++++

    it { should validate_presence_of(:name) }

    describe "uniqueness"do
      subject { FactoryGirl.create(:logger_name) }
      it { should validate_uniqueness_of(:name) }
    end

  end
end

Version data entries

23 entries across 23 versions & 1 rubygems

Version Path
naf-1.1.2 spec/models/naf/logger_name_spec.rb
naf-1.1.1 spec/models/naf/logger_name_spec.rb
naf-1.1.0 spec/models/naf/logger_name_spec.rb