Change from each to each_value;drop assignment in habtm

1. Change from each to each_value since we did not use key in habtm
2. Drop assignment of value to sum in test