[rspec-users] validating if a cell has any of the options.

Hillary Hueter weimar1927 at gmail.com
Fri Mar 30 16:52:58 UTC 2012


The example as it exists today: 
   it "should show all applications" do  
      I.new do |c|
      c.login_flow(:userid => $support, :password => $password) ## Logs in
      c.manage_application_page.filter.when_present.flash
      c.manage_application_page.filter.when_present.select_value("All") ## 
Checks that the dropdown exists and changes it to "Show All Applications"
      #Assertion
        c.manage_application_page.applications_table.tr.each do | cell |
              if ["Active", "Inactive", "Deleted"].include? cell.text()
                puts cell.text()
              end
           end
        end
      end

An example of the other tests: 

   it "should show all active applications" do ### Checking the Application 
Filter "Show All Active Applications" is working properly
    Insight.new do |c|
      c.login_flow(:userid => $support, :password => $password) ## Logs in
      c.manage_application_page.filter.when_present.flash
      
c.manage_application_page.filter.when_present.select_value("AllActive") ## 
Checks that the dropdown exists and changes it to "Show All Active 
Applications"
      #Assertion
        c.manage_application_page.applications_table.tr.each do |cell|
            cell.text.should_not == 'Deleted'
            cell.text.should_not == 'Inactive'
        end
    end 
  end 




On Thursday, March 29, 2012 4:45:21 AM UTC-7, dchel... at gmail.com wrote:
>
> On Wed, Mar 28, 2012 at 5:11 PM, Hillary Hueter <weimar1927 at gmail.com> 
> wrote:
> > I'm testing the filter on a table. One of the filter options is "Show 
> All".
> > So for my other tests I've been looping through the rows and seeing if 
> the
> > table cell that contains the status doesn't include text 
> (cell.should_not ==
> > 'Active').
>
> Please post one of these examples so we can see precisely what you're
> already doing.
>
> Thx,
> David
>
> > However when the filter is set to all it can include any of the three
> > statuses (Active, Inactive, Deleted).
> >
> > Using any of the rspec matchers how can I validate this?
> _______________________________________________
> rspec-users mailing list
> rspec-users at rubyforge.org
> http://rubyforge.org/mailman/listinfo/rspec-users
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://rubyforge.org/pipermail/rspec-users/attachments/20120330/b15a5e72/attachment.html>


More information about the rspec-users mailing list