Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>@SteveRobillard has addressed the missing end error message in his reply, but you have another big problem with how you are trying to use rspec there. The problem is that you are not really doing anything with the results of the .include? method since there is no .should there. Your code is executing the method, but just effectively tossing the 'true' or 'false' that is returned into the bit-bucket. That test will never fail because you are missing any kind of validation. I think that line needs to be closer to</p> <pre><code>describe "Copyright statement" do it "should exist" do @b.text.should include "Ark © 1" end end </code></pre> <p>Correcting that probably will not fix your missing end issue, but without something like that, your 'tests' are not actually testing anything.</p> <p>Also if it was me, I'd not only want to see that the copyright was somewhere in the html, but in a specific place such as the footer, which is typically inside some kind of container such as a div. If that div had an id of 'footer' then that part of the code would be like this</p> <pre><code>it "should be found within the footer" do @browser.div(:id =&gt; 'footer').text.should include 'copyright © Yoyodyne 1984' end </code></pre> <p>A good way to see rspec used with Watir is to look at the rspec files for watir itself, for example the spec for a div element and all the tests for what it should do is at <a href="https://github.com/watir/watirspec/blob/master/div_spec.rb" rel="nofollow">https://github.com/watir/watirspec/blob/master/div_spec.rb</a></p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload