All threads / How do I test the order of elements on a rails app page with Rspec / Capybara?
Ask A Question

Notifications

You’re not receiving notifications from this thread.

How do I test the order of elements on a rails app page with Rspec / Capybara?

Micheal Waldrup asked in Testing

I have a 'Team' index page and I just want to TDD the ordering of the elements on page. My instructions are to validate they are showing most recently created first.

I know how to do the actual implementation, just not sure how to test that a team created today shows up before a team created yesterday.

Thanks!

I'm familiar with the nitty-gritty of putting this into practice, but I'm stumped as to how to guarantee that a team made today would appear ahead of one made yesterday during testing.

Join the discussion

Want to stay up-to-date with Ruby on Rails?

Join 68,326+ developers who get early access to new tutorials, screencasts, articles, and more.

    We care about the protection of your data. Read our Privacy Policy.

    logo Created with Sketch.

    Screencast tutorials to help you learn Ruby on Rails, Javascript, Hotwire, Turbo, Stimulus.js, PostgreSQL, MySQL, Ubuntu, and more. Icons by Icons8

    © 2022 GoRails, LLC. All rights reserved.