rails-dom-testing

Extracting DomAssertions and SelectorAssertions from ActionView. (by rails)

Rails-dom-testing Alternatives

Similar projects and alternatives to rails-dom-testing

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a better rails-dom-testing alternative or higher similarity.

rails-dom-testing reviews and mentions

Posts with mentions or reviews of rails-dom-testing. We have used some of these posts to build our list of alternatives and similar projects. The last one was on 2023-06-05.
  • Did you know Nokogiri now has opt-in HTML5 parsing?
    7 projects | /r/ruby | 5 Jun 2023
    Switching to HTML5 parsing for everything is a very good idea, but in a lot of cases it's not straightforward because -- blurgh -- people tend to write unit tests that assert on the exact output string. Currently Discourse is dealing with this, and I've started work to upgrade Mastodon and am hitting similar problems. (Worth noting that Rails provides a test helper, assert_dom_equals, that should cover the majority of use cases.)
  • https://np.reddit.com/r/rails/comments/mfj94y/is_there_a_way_to_unit_test_a_regular_view/gsujvx5/
    1 project | /r/backtickbot | 30 Mar 2021
    class SomeViewTest < ActiveSupport::TestCase include Rails::Dom::Testing::Assertions::SelectorAssertions def test_some_view html = ActionController::Base.new.render_to_string "shared/_progress_indicator", layout: false, locals: { percent: 9 } # @selected is part of SelectorAssertions # https://github.com/rails/rails-dom-testing/blob/8f5acdfcb83a888c06592bad05475b7463998d1b/test/selector_assertions_test.rb#L332 @selected = Nokogiri::HTML.parse(html) # And then write the view tests assert_select "div" # etc. end end
  • Is there a way to unit test a regular view ?
    2 projects | /r/rails | 29 Mar 2021
    # @selected is part of SelectorAssertions # https://github.com/rails/rails-dom-testing/blob/8f5acdfcb83a888c06592bad05475b7463998d1b/test/selector_assertions_test.rb#L332 @selected = Nokogiri::HTML.parse(html) # And then write the view tests assert_select "div" # etc.
  • A note from our sponsor - SaaSHub
    www.saashub.com | 1 May 2024
    SaaSHub helps you find the best software and product alternatives Learn more →

Stats

Basic rails-dom-testing repo stats
3
169
7.8
4 months ago

rails/rails-dom-testing is an open source project licensed under MIT License which is an OSI approved license.

The primary programming language of rails-dom-testing is Ruby.

Popular Comparisons


Sponsored
SaaSHub - Software Alternatives and Reviews
SaaSHub helps you find the best software and product alternatives
www.saashub.com