Project

General

Profile

« Previous | Next » 

Revision e14b5758

Added by Greg Sutcliffe over 9 years ago

Fixes #7733 - Remove hosts.yml fixtures and use FactoryGirl instead

View differences:

test/integration/fact_value_test.rb
class FactValueTest < ActionDispatch::IntegrationTest
def setup
@host = FactoryGirl.create(:host)
FactoryGirl.create(:fact_value, :value => '2.6.9',:host => @host,
:fact_name => FactoryGirl.create(:fact_name, :name => 'kernelversion'))
end
test "index page" do
assert_index_page(fact_values_path,"Fact Values",nil,true)
end
......
test "host fact links" do
visit fact_values_path
within(:xpath, "//tr[contains(.,'kernelversion')]") do
click_link("my5name.mydomain.net")
click_link(@host.fqdn)
end
assert_equal 'host = my5name.mydomain.net', find_field('search').value
assert_equal "host = #{@host.fqdn}", find_field('search').value
end
test "fact_name fact links" do
visit fact_values_path
within(:xpath, "//tr[contains(.,'ipaddress')]") do
#first("ipaddress").click #click_link returns ambigous
within(:xpath, "//tr[contains(.,'kernelversion')]") do
first(:xpath, "//td[2]/a").click
end
assert_equal 'name = ipaddress', find_field('search').value
assert_equal 'name = kernelversion', find_field('search').value
end
test "value fact links" do

Also available in: Unified diff