Sha256: 1257328a5a8f8b8f49945dc6380f2d47d5a0d652b2b6a86242673ae8d4400449

Contents?: true

Size: 1.57 KB

Versions: 23

Compression:

Stored size: 1.57 KB

Contents

require 'spec_helper'

module Naf
  describe ApplicationRunGroupRestriction do
    # Mass-assignment
    [:application_run_group_restriction_name].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 have_many(:application_schedules) }
    it { should have_many(:historical_jobs) }

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

    it { should validate_presence_of(:application_run_group_restriction_name) }

    #----------------------
    # *** Class Methods ***
    #++++++++++++++++++++++

    describe "#no_limit" do
      let!(:no_limit) { FactoryGirl.create(:no_limit) }

      it "return the no limit group restriction" do
        ::Naf::ApplicationRunGroupRestriction.no_limit.should == no_limit
      end
    end

    describe "#limited_per_machine" do
      let!(:limited_per_machine) { FactoryGirl.create(:limited_per_machine) }

      it "return the limited per machine group restriction" do
        ::Naf::ApplicationRunGroupRestriction.limited_per_machine.should == limited_per_machine
      end
    end

    describe "#limited_per_all_machines" do
      let!(:limited_per_all_machines) { FactoryGirl.create(:limited_per_all_machines) }

      it "return the limited per all machines group restriction" do
        ::Naf::ApplicationRunGroupRestriction.limited_per_all_machines.should == limited_per_all_machines
      end
    end

  end
end

Version data entries

23 entries across 23 versions & 1 rubygems

Version Path
naf-2.1.13 spec/models/naf/application_run_group_restriction_spec.rb
naf-2.1.12 spec/models/naf/application_run_group_restriction_spec.rb
naf-2.1.11 spec/models/naf/application_run_group_restriction_spec.rb
naf-2.1.10 spec/models/naf/application_run_group_restriction_spec.rb
naf-2.1.9 spec/models/naf/application_run_group_restriction_spec.rb
naf-2.1.8 spec/models/naf/application_run_group_restriction_spec.rb
naf-2.1.6 spec/models/naf/application_run_group_restriction_spec.rb
naf-2.1.5 spec/models/naf/application_run_group_restriction_spec.rb
naf-2.1.4 spec/models/naf/application_run_group_restriction_spec.rb
naf-2.1.3 spec/models/naf/application_run_group_restriction_spec.rb
naf-2.1.2 spec/models/naf/application_run_group_restriction_spec.rb
naf-2.1.1 spec/models/naf/application_run_group_restriction_spec.rb
naf-2.1.0 spec/models/naf/application_run_group_restriction_spec.rb
naf-2.0.4 spec/models/naf/application_run_group_restriction_spec.rb
naf-2.0.3 spec/models/naf/application_run_group_restriction_spec.rb
naf-2.0.2 spec/models/naf/application_run_group_restriction_spec.rb
naf-2.0.1 spec/models/naf/application_run_group_restriction_spec.rb
naf-2.0.0 spec/models/naf/application_run_group_restriction_spec.rb
naf-1.1.4 spec/models/naf/application_run_group_restriction_spec.rb
naf-1.1.3 spec/models/naf/application_run_group_restriction_spec.rb