-
Notifications
You must be signed in to change notification settings - Fork 269
Specifying a variant in rspec tests #198
Comments
Yup! Please see https://github.com/assaf/vanity#testing. But please let me Closes #198 On Tue, Mar 25, 2014 at 6:16 PM, Daniel Wintschel
|
Hi @phillbaker - I actually had already tried this approach, and ended up monkey around for a couple hours but to no avail. The problems start with Vanity complaining about there being no Vanity context. From there I tried creating a vanity context and specifying the test to choose using the syntax above -- the result was that there was no runtime error in terms of code execution, but Vanity is definitely not choosing the test that I specify per the syntax provided above. Is there something else that needs to be done? Do the vanity test helpers need to be included in our spec_helper.rb somehow? Adding a "raise" into the vanity test_helper doesn't result in an error being raised when our tests are run, which leads me to believe that some setup that may be required by vanity is not being included. Would love to know if you can point me a little further along the path, but if you need more info, I can definitely get you some more specifics. Thanks. |
@humandoing looks like Vanity isn't initializing. Definitely a bug - let me poke around and get back to you. Also looks like #199 is related. |
Sorry for the slow response @humandoing. How are you starting your tests? |
Hi @philbaker -- starting tests using If I can provide any additional details please let me know. On Apr 8, 2014, at 5:27 AM, Phill Baker notifications@github.com wrote:
|
I was able to reproduce this, thanks. Looks like a regression that the test On Tue, Apr 8, 2014 at 11:10 AM, Daniel Wintschel
|
Sorry this took so long to solve. Finally figured out a work around for controller specs. Please use a before filter with the following:
So a full spec would look like:
I'll probably extract this to a file to be included in the spec helper and update the documentation, but wanted to post it here for other folks with this problem. |
Closing for #209 |
Hey there,
We've started using vanity for A/B testing in a project, and one issue that we've run into is that a lot of the A/B tests we're running change copy or structure that our automated tests are using. This would be fine if we could force the A/B test to always choose a specific test variant (the control) -- but so far I have not been able to figure out how this works (in spite of reading the documentation and working on it for several hours).
Is there a proper way to do this that I simply have not found?
Thanks!
The text was updated successfully, but these errors were encountered: