Sha256: 015a36664eb1081701a41cb0e2e5ec3cb302440bb79ce436ca4be332f69bdc60
Contents?: true
Size: 1.3 KB
Versions: 18
Compression:
Stored size: 1.3 KB
Contents
require 'spec_helper' module Naf describe MachineRunnerInvocation do # Mass-assignment [:machine_runner_id, :pid, :dead_at, :wind_down_at, :commit_information, :branch_name, :repository_name, :deployment_tag, :uuid].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(:machine_runner) } it { should have_many(:historical_jobs) } #-------------------- # *** Validations *** #++++++++++++++++++++ it { should validate_presence_of(:machine_runner_id) } it { should validate_presence_of(:pid) } #---------------------- # *** Class Methods *** #++++++++++++++++++++++ describe "#recently_marked_dead" do let!(:invocation) { FactoryGirl.create(:machine_runner_invocation, dead_at: Time.zone.now - 1.hour) } before do FactoryGirl.create(:machine_runner_invocation, dead_at: Time.zone.now - 40.hours) end it "return the correct invocation" do ::Naf::MachineRunnerInvocation.recently_marked_dead(24.hours).should == [invocation] end end end end
Version data entries
18 entries across 18 versions & 1 rubygems