I am a newbie in Ruby and I have a problem with if condition and page.should have when I programmed the A/B Test for log in function.
This is my code:
if (page.should have_css("body.bg-b")) || (page.should have_css("body.bg-c"))
#do something
else
#do something
end
It works fine in the if condition. My problem is in the case the page doesn't have bg-b or bg-c, it should go to else condition, right, but it stopped running and said
Capybara::ExpectationNotMet: expected to find css "body.bg-b" but there were no matches
Is there something wrong with this code?
Thanks