0
有沒有一種方法可以使用Factory Girl在Ruby on Rails中對測試數據庫進行新的更改?Ruby on Rails測試數據庫不提交新記錄
我有以下工廠:
Factory.define :shipping_info do |si|
si.name "Foo Bar"
si.street "12 Candy Lane"
si.country "US"
si.zip "12345"
si.state "IL"
end
和我有以下測試:
require File.dirname(__FILE__) + '/../../spec_helper'
describe CgCart::ShippingInfo do
before(:each) do
@order = Factory(:order)
@order.order_line_item = Factory(:order_line_item)
@shipping_info = Factory(:shipping_info)
end
it "order should not be nil" do
@shipping_info.should_not be_nil
end
end
當我運行這個測試通過。但是,我的測試數據庫中沒有創建新記錄。我需要那裏的數據供Dameon使用。
有什麼建議嗎?
你的意思是你可以使用`tail -f`或者你不能? – vik 2015-01-14 13:39:45