Project

General

Profile

Actions

Refactor #13938

closed

Remove reports fixtures

Added by Dominic Cleal over 8 years ago. Updated over 6 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Tests
Target version:
Difficulty:
Triaged:
Fixed in Releases:
Found in Releases:

Description

The fixtures for reports, logs and messages cause problems under Rails 4.2 as they are associated to fixture hosts which no longer exist (since #7733). Since their hosts were removed, the reports should also be removed and tests should use FactoryGirl instead.

On 4.2, functional and integration tests for config reports fail when rendering links to report.host, which is always nil (and for normal use we have a presence check on host_id):

  1) Error:
ConfigReportsControllerTest#test_index:
ActionView::Template::Error: undefined method `name' for nil:NilClass
    app/models/report.rb:56:in `to_label'
    app/helpers/application_helper.rb:31:in `link_to'
    app/helpers/application_helper.rb:176:in `display_link_if_authorized'
    app/helpers/application_helper.rb:166:in `display_delete_if_authorized'
    app/views/config_reports/_list.html.erb:35:in `block in _app_views_config_reports__list_html_erb___4177766395673083355_151768240'
    app/views/config_reports/_list.html.erb:18:in `_app_views_config_reports__list_html_erb___4177766395673083355_151768240'
    app/views/config_reports/index.html.erb:3:in `_app_views_config_reports_index_html_erb__4196656909700471881_151739580'
    app/controllers/concerns/application_shared.rb:13:in `set_timezone'
    app/models/concerns/foreman/thread_session.rb:32:in `clear_thread'
    test/functional/config_reports_controller_test.rb:8:in `test_index'

Related issues 2 (0 open2 closed)

Related to Foreman - Refactor #7733: Remove Host FixturesClosedGreg Sutcliffe09/29/2014Actions
Blocks Foreman - Feature #13244: Upgrade Ruby on Rails to 4.2ClosedDominic Cleal01/15/2016Actions
Actions

Also available in: Atom PDF