You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This gives you access to their global setters and getters for user authentication. Thus if your view requires current_user you can set it up in your test.
Like devise, Test track also relies on methods that are globally accessible in rails rendering pipeline.
Work around
We have a work around where we monkey patch the test controller like this:
I think it would be helpful if the test_track_rails_client were to expose a some sort of test helper module for this purpose. That way we could write something like:
One small hitch is that the authorized user is currently configured at the controller level (self.test_track_identity). Devise doesn't have this problem because the define their "default scope" in an initializer:
Problem:
I would like to be able to render partials with test track flags in them in view specs.
Details:
With devise, you can use their controller helpers in your view specs like:
This gives you access to their global setters and getters for user authentication. Thus if your view requires
current_user
you can set it up in your test.Like devise, Test track also relies on methods that are globally accessible in rails rendering pipeline.
Work around
We have a work around where we monkey patch the test controller like this:
Proposed solution
I think it would be helpful if the test_track_rails_client were to expose a some sort of test helper module for this purpose. That way we could write something like:
One small hitch is that the authorized user is currently configured at the controller level (
self.test_track_identity
). Devise doesn't have this problem because the define their "default scope" in an initializer:A couple of ways we could handle this:
test_track_visitor
so that you can use the existing test helperstub_test_track_assignments ...
self.test_track_identity
into an initializer.The text was updated successfully, but these errors were encountered: