Fix the bug in the test.
The test will fail when the csv file is missing.
Fix bugs in the test.
Use stub for the controller test to avoid the effect from other tests.
Import database_cleaner gem.
Add database_cleaner settings in spec/spec_helper.rb.