Rspec; Assert new window URL string -


i put assertion that, when open new window, asserts url includes ?preview=true
have far:

p @browser.url.include? '?preview=true' 

however, when go run this, returns false.
if run

p @browser.url 

it reads url correctly (including, obviously, "?preview=true" part of string)
there method i'm missing reading part of url string?

i think you're on right track. rspec assertion, should able try partial url:

@browser.url.should include('?preview=true') 

you can following full url:

@browser.url.should == "google.com" 

Comments