Project

General

Profile

Bug #12996

Tests with errors after removing a plugin

Added by Ori Rabin over 3 years ago. Updated about 1 year ago.

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

Description

Some of the tests use the attributes method which return a hash of all the attributes in the db.
As a result after adding a plugin and removing it without getting rid of the columns that were added to host you get:

HostsControllerTest#test_0072_template_used returns templates with interfaces:
ActiveModel::MassAssignmentSecurity::Error: Can't mass-assign protected attributes for Host::Managed: salt_proxy_id, salt_environment_id
    app/controllers/hosts_controller.rb:606:in `template_used'
    app/controllers/concerns/application_shared.rb:13:in `set_timezone'
    app/models/concerns/foreman/thread_session.rb:32:in `clear_thread'
    test/functional/hosts_controller_test.rb:953:in `block in <class:HostsControllerTest>'

The tests should only try and assign the attributes that belong to Host::Managed.

Associated revisions

Revision d30a7ff3 (diff)
Added by Ori Rabin over 3 years ago

Fixes #12996 - Tests run without errors after removing a plugin

History

#1 Updated by The Foreman Bot over 3 years ago

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

#2 Updated by Ori Rabin over 3 years ago

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

#3 Updated by Dominic Cleal over 3 years ago

  • Category set to Tests
  • Legacy Backlogs Release (now unused) set to 71

Also available in: Atom PDF