Skip to content
This repository has been archived by the owner on Jan 1, 2024. It is now read-only.

Forcing Experiment Results for Cucumber tests

pauljamesrussell edited this page Feb 19, 2012 · 1 revision

You can force the chosen option of an experiment in Cucumber by creating an ab_test_steps.rb containing the following:

Before do
  e = Vanity.playground.experiment(:experiment_name)
  e.identify { |controller| 1 }
  e.chooses(:value)
end

This forces the experiment to always use the same identity, and then sets the chosen value for that identity, thus making sure that the results are always consistent.

Clone this wiki locally