Skip to content

Commit

Permalink
Use retire_now to mark job as retired without going through any
Browse files Browse the repository at this point in the history
retirement state machine.
  • Loading branch information
tinaafitz committed Mar 23, 2017
1 parent 8dd095d commit 47cb8b9
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,9 @@ class ManageIQ::Providers::EmbeddedAnsible::AutomationManager::Job < ManageIQ::P
include ManageIQ::Providers::AnsibleTower::Shared::AutomationManager::Job

require_nested :Status

def retire_now(requester = nil)
update_attributes(:retirement_requester => requester)
finish_retirement
end
end
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
require 'support/ansible_shared/automation_manager/job'

describe ManageIQ::Providers::EmbeddedAnsible::AutomationManager::Job do
let(:job) { FactoryGirl.create(:embedded_ansible_job) }

it_behaves_like 'ansible job'

it 'processes retire_now properly' do
expect(job).to receive(:finish_retirement).once
job.retire_now
end
end

0 comments on commit 47cb8b9

Please sign in to comment.