I've run into a very confusing problem...
All my tests pass when i run them in isolation. When I run them like rake test, after my integration tests run, Machinist says that it can't find blueprints anymore.
To get the capybara tests working I have to invoke some magic ...
To get transactional fixtures I'm forcing all activity onto a single transaction like this:
#always use the same connection so updates inside of transactions are visible.
#allows the use of use_transactional_fixtures
ActiveRecord::ConnectionAdapters::ConnectionPool.class_eval do
def current_connection_id
#always fetch the connection for the main thread
# was Thread.current.object_id
Thread.main.object_id
end
def clear_reloadable_connections!
#do nothing, when connections are reloaded, otherwise the only connection is severed on each request
end
end
After issuing something like
visit new_user_session_path
I have to do this
load "#{Rails.root}/test/blueprints.rb"
to be able to use my blueprints again.
Any ideas about how Machinist could lose its blueprints after a simple visit
?