[COOK-4477] Fix rubocop warnings and 1 failing test case