Note that there are some explanatory texts on larger screens.

plurals
  1. POCucumber test order of elements in table
    primarykey
    data
    text
    <p>I want to run a test that tests the order of the elements I want the order to be ascending by date. </p> <p>Here is my cucumber feature scenario and the step for the last sentence. </p> <pre><code>Scenario: Order of the events should be Ascending Given I am signed into an account called "Gorilla Tech" as a customer When I follow "Register" And I follow "Events" And I follow "Register new event" Then I should see the header "Use the form below to register a new event" And I fill in "Title" with "Apefest 2010" And I fill in "Event at" with "2010-01-07" And I fill in "Add a note" with "This was truly awesome" Then I press "Create" Then I follow "Register new event" And I fill in "Title" with "Monkeyfest 2010" And I fill in "Event at" with "2010-01-08" And I fill in "Add a note" with "Yeah" Then "Apefest 2010" should appear before "Monkeyfest 2010" Then /"(.*)" should appear before "(.*)"/ do |first_example, second_example| response.body.should =~ /#{first_example}.*#{second_example}/ end </code></pre> <p>I really have two problems here. The first one is how do i specify my test correctly? Can i specify my test above different and more correct? </p> <p>What i want to do is to register 2 different events under 2 different dates. The event will later appear as a list on the webpage. Then i want to check if the events are in order by date . I want the event with the newest date to appear on the top. </p> <p>here is the code with the collection i want to test. In some way i want to check if the collection in the div below has the an ascending order by date. </p> <pre><code>&lt;div id="feeds"&gt; &lt;table&gt; &lt;caption&gt;&lt;%= t('events.all') %&gt;&lt;/caption&gt; &lt;thead&gt; &lt;tr&gt; &lt;th&gt;&lt;%= Event.t(:title) %&gt;&lt;/th&gt; &lt;th&gt;&lt;%= Event.t(:event_at) %&gt;&lt;/th&gt; &lt;th&gt;&lt;/th&gt; &lt;/tr&gt; &lt;/thead&gt; &lt;tbody&gt; &lt;%= render :partial =&gt; 'event', :collection =&gt; @events %&gt; &lt;/tbody&gt; &lt;/table&gt; &lt;/div&gt; &lt;%= will_paginate(@events) %&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

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