RSpec

If the database is abnormal, just run the following rakes to have a clean test database

bundle exec rake db:drop RAILS_ENV=test
bundle exec rake db:create RAILS_ENV=test

Set private instance variable

object.instance_variable_set(:@var, AnyValue)

Reference

results matching ""

    No results matching ""