Skip to content

Commit

Permalink
Tower CUD refresh_in_provider followed by manager
Browse files Browse the repository at this point in the history
  • Loading branch information
jameswnl committed May 8, 2017
1 parent fc36cd5 commit ee90bbf
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,10 @@ def update_in_provider(params)
with_provider_object do |provider_object|
provider_object.update_attributes!(params)
end
self.class.send('refresh', self)
if respond_to?(:refresh_in_provider)
refresh_in_provider
end
self.class.send('refresh', manager)
reload
rescue AnsibleTowerClient::ClientError => error
raise
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,8 @@ def store_new_project(project, manager)

it "#update_in_provider to succeed and send notification" do
expect(AnsibleTowerClient::Connection).to receive(:new).and_return(atc)
expect(EmsRefresh).to receive(:queue_refresh_task).with(project).and_return([finished_task])
expect(EmsRefresh).to receive(:queue_refresh_task).with(manager).and_return([finished_task])
expect(project).to receive(:refresh_in_provider)
expect(Notification).to receive(:create).with(expected_notify)
expect(project.update_in_provider({})).to be_a(described_class)
end
Expand Down

0 comments on commit ee90bbf

Please sign in to comment.