summaryrefslogtreecommitdiffstats
path: root/spec/unit/indirector/node
diff options
context:
space:
mode:
authorLuke Kanies <luke@madstop.com>2009-08-14 13:52:03 -0700
committerJames Turnbull <james@lovedthanlost.net>2009-08-18 07:44:54 +1000
commit7e0924737d817644402b1c3d2d5abb2cf006e76b (patch)
treeef9edd6853bdedb7ad7e4942844fe106f05329b7 /spec/unit/indirector/node
parenta35e9bf918db0f6fca45d8b0b002a372cff4f982 (diff)
downloadpuppet-7e0924737d817644402b1c3d2d5abb2cf006e76b.tar.gz
puppet-7e0924737d817644402b1c3d2d5abb2cf006e76b.tar.xz
puppet-7e0924737d817644402b1c3d2d5abb2cf006e76b.zip
Fixing fact-missing problem when puppet.conf is reparsed
Signed-off-by: Luke Kanies <luke@madstop.com>
Diffstat (limited to 'spec/unit/indirector/node')
-rwxr-xr-xspec/unit/indirector/node/active_record.rb14
1 files changed, 14 insertions, 0 deletions
diff --git a/spec/unit/indirector/node/active_record.rb b/spec/unit/indirector/node/active_record.rb
index 75a377230..1d90295cf 100755
--- a/spec/unit/indirector/node/active_record.rb
+++ b/spec/unit/indirector/node/active_record.rb
@@ -17,4 +17,18 @@ describe "Puppet::Node::ActiveRecord" do
it "should use Puppet::Rails::Host as its ActiveRecord model" do
Puppet::Node::ActiveRecord.ar_model.should equal(Puppet::Rails::Host)
end
+
+ it "should call fact_merge when a node is found" do
+ db_instance = stub 'db_instance'
+ Puppet::Node::ActiveRecord.ar_model.expects(:find_by_name).returns db_instance
+
+ node = Puppet::Node.new("foo")
+ db_instance.expects(:to_puppet).returns node
+ ar = Puppet::Node::ActiveRecord.new
+
+ node.expects(:fact_merge)
+
+ request = Puppet::Indirector::Request.new(:node, :find, "what.ever")
+ ar.find(request)
+ end
end