Project

General

Profile

Refactor #13938

Remove reports fixtures

Added by Dominic Cleal about 6 years ago. Updated almost 4 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Tests
Target version:
Difficulty:
Triaged:
Bugzilla link:
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

Related to Foreman - Refactor #7733: Remove Host FixturesClosed2014-09-29
Blocks Foreman - Feature #13244: Upgrade Ruby on Rails to 4.2Closed2016-01-15

Associated revisions

Revision 141dead7 (diff)
Added by Dominic Cleal about 6 years ago

fixes #13938 - remove reports fixtures

Under Rails 4.2, the rendering of the config_reports#show page was
failing as the reports fixtures referenced hosts that didn't exist.
Presence of host_id is validated under normal circumstances.

History

#1 Updated by Dominic Cleal about 6 years ago

#2 Updated by Dominic Cleal about 6 years ago

#3 Updated by The Foreman Bot about 6 years ago

  • Status changed from Assigned to Ready For Testing
  • Pull request https://github.com/theforeman/foreman/pull/3248 added

#4 Updated by Dominic Cleal about 6 years ago

  • Status changed from Ready For Testing to Closed
  • % Done changed from 0 to 100

#5 Updated by Dominic Cleal about 6 years ago

  • Legacy Backlogs Release (now unused) set to 136

Also available in: Atom PDF