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/report_test.rb
class ReportTest < ActionDispatch::IntegrationTest
def setup
@report = FactoryGirl.create(:report, :old_report)
end
test "index page" do
visit reports_path
assert find_button('Search').visible?, "Search button is not visible"
......
test "reports for host" do
visit reports_path
click_link("my5name.mydomain.net")
assert_equal 'host = my5name.mydomain.net', find_field('search').value
click_link(@report.host.fqdn)
assert_equal "host = #{@report.host.fqdn}", find_field('search').value
end
test "show specific report" do
visit reports_path
click_link("7 days ago")
assert page.has_selector?('h1', :text => "my5name.mydomain.net"), "'my5name.mydomain.net' was expected in the <h1> tag, but was not found"
visit report_path(@report)
assert page.has_selector?('h1', :text => @report.host.fqdn), "hostname was expected in the <h1> tag, but was not found"
end
end

Also available in: Unified diff