Hi everyone. I've been getting an error, which I think could be solved by disabling acts_as_audited when running tests, or at least stubbing current_user in audit sweeper. The error is below. What do you think I should do?
NoMethodError in 'Order should create a new instance given valid attributes'
You have a nil object when you didn't expect it!
The error occurred while evaluating nil.current_user
/home/ramon/rails/app/vendor/plugins/acts_as_audited/lib/acts_as_audited/audit_sweeper.rb:73:in `send'
/home/ramon/rails/app/vendor/plugins/acts_as_audited/lib/acts_as_audited/audit_sweeper.rb:73:in `current_user'
/home/ramon/rails/app/vendor/plugins/acts_as_audited/lib/acts_as_audited/audit_sweeper.rb:61:in `after_create'
./spec/models/order_spec.rb:13:
In spec/models/order_spec.rb I've tried stubbing AuditSweeper.current_user, template.current_user, and controller.current_user to return a mock User model. None work.
Any help is appreciated. Thanks!