RedHatQE/katello.auto — pull request #308 by sghai (2013-02-22 10:31:50+00:00)
Title: Same system get registered to different environments

I created a system and register it first env dev-XX and then register same system with env test-XX. Now UI shoudn't list the system under env dev-XX.

So I'm validating this with:
(assert/is (not= (get :environment_id mysys)
(api/get-id-by-name :environment env-dev)

but I'm getting 'nil' with "(get :environment_id mysys)"

For ex: I created a system and register it with both env. and getting the resuts via api:

=> (map :environment_id (all-entities :system))
(3)

=> (all-entities :system)
[{:environment_id 3, :environment {:name "test-0222-152838-174", :updated_at "2013-02-21T21:57:58Z", :prior_id 1, :organization "ACME_Corporation", :created_at "2013-02-21T21:57:58Z", :library false, :prior "Library", :label "test-0222-152838-174", :id 3, :description "", :organization_id 1}, :activation_key [], :name "reg-with-env-change-0222-152850-488", :updated_at "2013-02-21T22:03:41Z", :location "None", :created_at "2013-02-21T22:03:41Z", :uuid "9709e2b6-7ae2-465a-ad75-226e2d93d8af", :serviceLevel "", :id 2, :description "Initial Registration Params", :system_template_id nil, :ipv4_address "127.0.0.1"}]

=> (get :environment_id "reg-with-env-change-0222-152850-488")
nil

Please correct me here.. not sure why I'm getting 'nil' instead of '3' here.