How to test it within the application
Hi,
I was curious to understand how can we write a test case inside the application using ActiveRecord around Read/Write queries and check which query hit master and which one did it for slave.
I wish to add a Wiki page/Documentation on How to test as that is an essential part which I think is missing in such an awesome gem.
cc/ @bleonard @rosa
I would think it could be similar to the gem test suite itself. More or less expect statements about where is should call. The bad thing is you'd have to know the internals.
If we were serious about enabling "end user" testing, we might have some sort of code to allow that. Makara.raise_if_master_called! or some set like that.
Most people have seemed to just expect that it does what it does. No one is testing ActiveRecord. Then they dive in if things seem weird. Clearly pros/cons.