simple_abs
simple_abs copied to clipboard
same alternative isn't always displayed to the user.
I have this code :
def search
if ab_test('display_flash', [true, false]) #simple_abs
flash[:notice]
end
end
When I refresh the search's page I randomly get the notice or not. I should have it always or never until I delete my cookies, shouldn't I ?
Ah, I'm not sure I've tested this with boolean test values. What if instead you tested for
if ab_test('display_flash', ["true", "false"]) == "true"
end
To see if strings work.
OK, it seems this code works fine :
def search
if ab_test('display_flash', ['true', 'false']) == 'true'
flash[:notice]
end
end
We wrote our comments at the same time :)