Refactor #13938
Remove reports fixtures
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
Associated revisions
History
#1
Updated by Dominic Cleal about 6 years ago
- Related to Refactor #7733: Remove Host Fixtures added
#2
Updated by Dominic Cleal about 6 years ago
- Blocks Feature #13244: Upgrade Ruby on Rails to 4.2 added
#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
Applied in changeset 141dead709ca7f99ffdc78ba6d6dca60f3d8188f.
#5
Updated by Dominic Cleal about 6 years ago
- Legacy Backlogs Release (now unused) set to 136
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.