You can use the Rails logger to write directly to your log/test.log .
I usually add the following to spec_helper.rb
def logger Rails::logger end
Now you can write anywhere in your specification like this:
describe Customer do it "logs factory girl generated objects" do customer = Factory( :customer ) logger.warn( customer.pretty_inspect ) end end
This will print the generated customer object with all properties
source share