javascript - Sanity check on Capybara match -
i trying write capybara test case. html looks this, obtained writing out "page.body" file:
<div class="diet_form"><div class="wrapper_no_arrow"> <div class="header"> <form name="diet" id="new-diet"> <label for="name"> new diet's name</label> <input type="text" value="" id="name" name="name" /> <a id="submit_button" class="button-green">create diet</a>
i'm trying work out right capybara match:
fill_in "name", :with => "test diet" page.should have_link("submit_button")
these 2 statements fail find input box , submit button. can help me write right matcher this?
here's error 2nd statement:
failure/error: page.should have_link("submit_button") expected link "submit_button" homecoming
the test failing because not have proper link on page. alter line that's failing to
page.should have_selector('a#submit_button')
javascript ruby-on-rails-3 capybara
No comments:
Post a Comment