这是我的示例测试块
it 'should redirect to account portfolio items page if user is creative and its first visit is false and sign in count is 1' do
@creative.first_visit = false
@creative.sign_in_count = 1
@creative.save!
sign_in @creative
get :index
@creative.reload
@creative.first_visit.should eql(true)
response.should redirect_to account_portfolio_items_path
end
如果我不使用保存和重新加载测试将失败。你知道它为什么会发生,我该如何处理它?
这是我的测试宝石。
group :test do
gem "rspec-rails"
gem "factory_girl"
gem "database_cleaner"
gem 'webrat', '0.7.1'
gem 'shoulda'
end