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-2.1.13 spec/models/naf/logger_name_spec.rb
naf-2.1.12 spec/models/naf/logger_name_spec.rb
naf-2.1.11 spec/models/naf/logger_name_spec.rb
naf-2.1.10 spec/models/naf/logger_name_spec.rb
naf-2.1.9 spec/models/naf/logger_name_spec.rb
naf-2.1.8 spec/models/naf/logger_name_spec.rb
naf-2.1.6 spec/models/naf/logger_name_spec.rb
naf-2.1.5 spec/models/naf/logger_name_spec.rb
naf-2.1.4 spec/models/naf/logger_name_spec.rb
naf-2.1.3 spec/models/naf/logger_name_spec.rb
naf-2.1.2 spec/models/naf/logger_name_spec.rb
naf-2.1.1 spec/models/naf/logger_name_spec.rb
naf-2.1.0 spec/models/naf/logger_name_spec.rb
naf-2.0.4 spec/models/naf/logger_name_spec.rb
naf-2.0.3 spec/models/naf/logger_name_spec.rb
naf-2.0.2 spec/models/naf/logger_name_spec.rb
naf-2.0.1 spec/models/naf/logger_name_spec.rb
naf-2.0.0 spec/models/naf/logger_name_spec.rb
naf-1.1.4 spec/models/naf/logger_name_spec.rb
naf-1.1.3 spec/models/naf/logger_name_spec.rb