Revision b1f4f883
Added by Joseph Magen almost 11 years ago
test/unit/operatingsystem_test.rb | ||
---|---|---|
assert record.valid?
|
||
end
|
||
|
||
test "should find by fullname string" do
|
||
str = "Redhat 6.1"
|
||
os = Operatingsystem.find_by_fullname(str)
|
||
assert_equal str, os.fullname
|
||
end
|
||
|
||
test "should return os fullnames for method operatingsystem_names" do
|
||
medium = media(:one)
|
||
assert_equal 2, medium.operatingsystem_ids.count
|
||
assert_equal 2, medium.operatingsystem_names.count
|
||
assert_equal ["Redhat 6.1", "centos 5.3"], medium.operatingsystem_names.sort
|
||
end
|
||
|
||
test "should add os association by passing fullnames of operatingsystems" do
|
||
medium = media(:one)
|
||
medium.operatingsystem_names = ["centos 5.3", "Redhat 6.1", "Ubuntu 10.10"]
|
||
assert_equal 3, medium.operatingsystem_ids.count
|
||
assert_equal 3, medium.operatingsystem_names.count
|
||
assert_equal ["Redhat 6.1", "Ubuntu 10.10", "centos 5.3"], medium.operatingsystem_names.sort
|
||
end
|
||
|
||
test "should delete os associations by passing fullnames of operatingsystems" do
|
||
medium = media(:one)
|
||
medium.operatingsystem_names = ["centos 5.3"]
|
||
assert_equal 1, medium.operatingsystem_ids.count
|
||
assert_equal 1, medium.operatingsystem_names.count
|
||
assert_equal ["centos 5.3"], medium.operatingsystem_names
|
||
end
|
||
|
||
end
|
Also available in: Unified diff
fixes #2932 - add find_by_fullname for Operatingsystem