I'm having trouble making vanity choose one alternative for a test
case. It seems to be honoring the decision in the setup of the test
case but not in the mailer part of it (the a/b test is part of an
email body).
here is the test case
context "test body option wants you to try our site and has given
you $5 off" do
setup do
experiment(:referral_mailer_test).chooses(nil)
experiment(:referral_mailer_test).chooses("wants you to try our
site and has given you $5 off")
10.times do
puts ab_test(:referral_mailer_test) # => wants you to try our
site and has given you $5 off
#this works fine
end
@user = Factory(:user)
@referral = Factory(:referral)
ReferralMailer.referral_email(@referral.id,"",0,@user.id).deliver!
end
should "show wants you to try our site and has given you $5 offl" do
10.times do
puts ab_test(:referral_mailer_test)
#this is sometimes different to the one above
end
end
end
thanks for your help
Sean