Project

General

Profile

« Previous | Next » 

Revision 316a4ccd

Added by Ohad Levy almost 12 years ago

  • ID 316a4ccd5fef61c7f0a9cd1ab6ff81fd8c551083

couple of test fixes after upgrading to a newer mocha/shoulda

View differences:

test/functional/environments_controller_test.rb
Environment.find_by_name("env1").puppetclasses.delete(Puppetclass.find_by_name("a"))
# db_tree of {"env1" => ["b", "c"], "env2" => ["a", "b", "c"]}
# disk_tree of {"env1" => ["a", "b", "c"],"env2" => ["a", "b", "c"]}
get :import_environments, {:proxy => smart_proxies(:puppetmaster)}, set_session_user
get :import_environments, {:proxy => smart_proxies(:puppetmaster).id}, set_session_user
assert_template "puppetclasses_or_envs_changed"
assert_select 'input#changed_new_env1[value*="a"]'
post :obsolete_and_new,
......
as_admin {Environment.create(:name => "env3")}
#db_tree of {"env1" => ["a", "b", "c"], "env2" => ["a", "b", "c"], "env3" => []}
#disk_tree of {"env1" => ["a", "b", "c"], "env2" => ["a", "b", "c"]}
get :import_environments, {:proxy => smart_proxies(:puppetmaster)}, set_session_user
get :import_environments, {:proxy => smart_proxies(:puppetmaster).id}, set_session_user
assert_template "puppetclasses_or_envs_changed"
assert_select 'input#changed_obsolete_env3'
post :obsolete_and_new,
......
assert host.errors.empty?
assert Environment.find_by_name("env1").hosts.count > 0
end
get :import_environments, {}, set_session_user # We need this to stop failures about number of calls. It is not really part of the test.
get :import_environments, {:proxy => smart_proxies(:puppetmaster).id}, set_session_user # We need this to stop failures about number of calls. It is not really part of the test.
# assert_template "puppetclasses_or_envs_changed". This assertion will fail. And it should fail. See above.
post :obsolete_and_new,
{"changed"=>

Also available in: Unified diff