Fix existing rspec tests based on linter output

Resolve issues found by rubocop once it is enabled in the repository by #2426 (closed)

Expected outcomes

  • bundle exec rubocop is clean in the primary branch of the charts
Edited by Robert Marshall