From d1db59b286476de737674a2c0996c7fa7b39a710 Mon Sep 17 00:00:00 2001 From: lgalis Date: Wed, 21 Jun 2017 14:37:04 -0400 Subject: [PATCH] Specs for ensure_managers moved to before_validation --- .../manageiq/providers/foreman/provider_spec.rb | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/spec/models/manageiq/providers/foreman/provider_spec.rb b/spec/models/manageiq/providers/foreman/provider_spec.rb index 6ceae29..d2ed72f 100644 --- a/spec/models/manageiq/providers/foreman/provider_spec.rb +++ b/spec/models/manageiq/providers/foreman/provider_spec.rb @@ -58,4 +58,16 @@ expect(CustomizationScript.count).to eq(0) end end + + describe "#save" do + it "will update the name for the manager" do + provider = FactoryGirl.create(:provider_foreman, :zone => FactoryGirl.create(:zone), :name => 'Old Name') + provider.save + expect(provider.configuration_manager.name).to eq('Old Name Configuration Manager') + + provider.name = 'New Name' + provider.save + expect(provider.configuration_manager.name).to eq('New Name Configuration Manager') + end + end end