Is there a quick way to output the value of variable in a rspec test? Something like this for example, in a controller to output a variable, I do:
raise variable.to_yaml
Is there something similar I can do in a rspec test to see the contents of a variable?
If you want the output to go into the log file (i.e. logs/test.log), you can use the rails logger.
If you want to see the output in the console, you can use the pretty printer ‘pp’.
Or you can use good ‘ol puts