Sha256: 404fb8aeee8a0a757b78f7ef28d13cfa054286f079f63bf11c3a7cfe16a05b1b
Contents?: true
Size: 929 Bytes
Versions: 23
Compression:
Stored size: 929 Bytes
Contents
require 'spec_helper' module Naf describe ApplicationSchedulePrerequisite do # Mass-assignment [:application_schedule_id, :prerequisite_application_schedule_id].each do |a| it { should allow_mass_assignment_of(a) } end [:id, :created_at].each do |a| it { should_not allow_mass_assignment_of(a) } end #--------------------- # *** Associations *** #+++++++++++++++++++++ it { should belong_to(:application_schedule) } it { should belong_to(:prerequisite_application_schedule) } #-------------------- # *** Validations *** #++++++++++++++++++++ it { should validate_presence_of(:prerequisite_application_schedule_id) } describe "uniqueness"do subject { FactoryGirl.create(:schedule_prerequisite) } it { should validate_uniqueness_of(:application_schedule_id).scoped_to(:prerequisite_application_schedule_id) } end end end
Version data entries
23 entries across 23 versions & 1 rubygems