I am trying to test a Backbone application running on top of Rails 3.2.8 using Cucumber, capybara, capybara-webkit, selenium-webdriver, rspec and jasmine. I use eco as a template engine for a basic template.
My problem is when I run the script using the @javascript tag using capybara-webkit or selenium, the page displayed does not contain all the model attribute data.
Here is the scenario:
@javascript Scenario : first scenario Given There is Model with "name" as name and "What is it about ?" as associated questions When I want to fill the questionnaire Then I should be on the SPA form And I should see "name" And I should see "What is it about?"
The script crashes to βAnd should I see what it is?β, Step, the page does not display the question, but shows the βnameβ, I put several debug statements in my base code using console.log, and I see that the model is true with all its attributes. In addition, it works live without any problems.
The template looks like this: 'show.jst.eco'
<p class="text-info"><%= @model.name %></p> <form id="quidget-form" class="form-vertical"> <% for question in @model.questions: %> <div class="issue_field"> <label class="string optional control-label"><%= question.question.question_text %></label> <div class="control-group text"> <textarea class="text answer" name="question-<%= question.question.id %>" id="question_<%= question.question.id %>" data-question="<%= question.question.question_text %>" rows="3"> </textarea> </div> </div> <% end %> <div class="controls"> <input type="submit" value="Additional Informations" id="quidget-step-one" class="btn btn-success">
A text box is displayed, but not the caption above with the question text
Any idea? I would like to see this passage so that I can test more complex logic with many steps.
thanks
source share