Sha256: a28900eb22ac5b784a63888c0c34c47d7a1a4944448d8cfd3c07d3eb1a2dcecc
Contents?: true
Size: 938 Bytes
Versions: 23
Compression:
Stored size: 938 Bytes
Contents
require 'spec_helper' module Naf describe LoggerStyleName do # Mass-assignment [:logger_style_id, :logger_name_id, :logger_level_id].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 belong_to(:logger_name) } it { should belong_to(:logger_style) } it { should belong_to(:logger_level) } #-------------------- # *** Validations *** #++++++++++++++++++++ it { should validate_presence_of(:logger_name_id) } it { should validate_presence_of(:logger_style_id) } describe "uniqueness"do subject { FactoryGirl.create(:logger_style_name) } it { should validate_uniqueness_of(:logger_style_id).scoped_to(:logger_name_id) } end end end
Version data entries
23 entries across 23 versions & 1 rubygems
Version | Path |
---|---|
naf-1.1.2 | spec/models/naf/logger_style_name_spec.rb |
naf-1.1.1 | spec/models/naf/logger_style_name_spec.rb |
naf-1.1.0 | spec/models/naf/logger_style_name_spec.rb |