(PUP-3334) Add test to ensure cache is cleared

In order to ensure that we don't encounter this issue again, add
a test case to environments_spec to ensure that the cache is being
properly cleared.

Additionally, fix a small bug in environment's list method where
a string should been converted to a symbol.