splitrb/split

ab_test doesn't yield metadata for excluded visitors

colinux opened this issue · 1 comments

Describe the bug
For an experiment having metadata and used with a, ab_test block in a view, if the user is ignored, the block won't yield the metadata but an empty Hash instead. So in this case, the example in the readme does not work (no text will be displayed in the <small> tag).

To Reproduce

  1. Define a experiment with metadata
  2. Configure split to ignore some users
  3. Use ab_test helper in a view with a block, using the metadata (like in the readme)
  4. Try as an ignored user

Expected behavior
Metadata are yield in the block instead of an empty Hash.

Note
This happens because metadata are retrieved from a Trial instance and not directly from the configuration.
The same problem occurs when redis is failing.

Should be fixed now 🚀