Skip to content

Instantly share code, notes, and snippets.

@stbenjam
Created January 22, 2014 18:46
Show Gist options
  • Save stbenjam/8564784 to your computer and use it in GitHub Desktop.
Save stbenjam/8564784 to your computer and use it in GitHub Desktop.
test "should not save if root password is undefined and host is managed" do
Setting[:root_pass] = nil
host = Host.create :name => "myfullhost", :managed => true
assert !host.valid?
assert host.errors[:root_pass].include?("should not be blank")
end
test "should save if root password is undefined when the compute resource is image capapble"
Setting[:root_pass] = nil
host = Host.create :name => "myfullhost", :managed => true, :compute_resource_id => compute_resources(:openstack).id
host.valid?
assert !host.errors[:root_pass].include?("should not be blank")
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment