-
Notifications
You must be signed in to change notification settings - Fork 269
Vanity not respecting test choice in Rspec #343
Comments
Hi there! Thanks for using vanity, sorry to see you're having an issue. There are some similar examples of using this helper in the vanity test suite:
(where Lines 132 to 134 in bc0205d
What are the value of the variables |
Hey, Thanks for the quick reply! One question I have based on your response is why are you using a symbol instead of a string to pass which experiment you are choosing:
In all the examples I've seen pass a string as the choice: #199 Does it need to be passed a symbol to work? In any case this is what I did: the method I'm trying to test is (which is a private method in ApplicationController for Rails):
I want two write two tests, one that the cookie gets set if not set, and the other that it does not get set if it's already present. I don't have the exact test I had written anymore but it's something like the following:
The above test would not reliably return the value in the cookie that I was forcing Vanity to choose. I had to end up testing it like this which is not ideal
Any help would be appreciated I was digging around the issues/source code for a while and couldn't figure out why it wasn't getting set. |
@phillbaker I just tested again using a symbol instead of a string for the value and it still does not work. |
@jennykortina sorry for the slow reply here, what version of rails were you using? |
I am trying to write a controller test in Rspec where I am forcing Vanity to choose a value, but the forced value is not respected
The text was updated successfully, but these errors were encountered: