*让测试run起来*
在map/Gemfile下添加以下配置
> gem 'user_login', :path => '../user_login'
> gem "authlogic"
配置数据库
在map/test/dummy下添加db文件夹,将上层目录的migrate下的东西拷到该目录下,运行rake db:migrate, rake db:test:prepare
定位夹具文件
在map/test/test_helper中添加配置
> #Run any available migration
> ActiveRecord::Migrator.migrate 'up'
>
> # Set fixtures root
> ActiveSupport::TestCase.fixture_path=(File.expand_path("../fixtures", __FILE__))
> ActiveSupport::TestCase.fixtures :all
让测试类找到夹具类
在相关测试文件中设置set_fixture_class :gps_data => 'GpsData' ,这样代码中gps_data(:id)就可以找到对象使用数据了