Skip to content

Commit

Permalink
Update dependencies and fix tests with the latest
Browse files Browse the repository at this point in the history
Update MiniTest => Minitest constant reference.

`rails-dom-testing` changed the `NO_STRIP` constant around, update the
code that references it via `ActionDispatch::Assertions` (because it was
included there) to point to the lib directly, making it more explicit.
  • Loading branch information
carlosantoniodasilva committed Oct 10, 2023
1 parent 921ce9c commit b9ba1ce
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 39 deletions.
64 changes: 33 additions & 31 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -8,67 +8,69 @@ PATH
GEM
remote: https://rubygems.org/
specs:
actionpack (7.0.4.2)
actionview (= 7.0.4.2)
activesupport (= 7.0.4.2)
rack (~> 2.0, >= 2.2.0)
actionpack (7.0.8)
actionview (= 7.0.8)
activesupport (= 7.0.8)
rack (~> 2.0, >= 2.2.4)
rack-test (>= 0.6.3)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.0, >= 1.2.0)
actionview (7.0.4.2)
activesupport (= 7.0.4.2)
actionview (7.0.8)
activesupport (= 7.0.8)
builder (~> 3.1)
erubi (~> 1.4)
rails-dom-testing (~> 2.0)
rails-html-sanitizer (~> 1.1, >= 1.2.0)
activemodel (7.0.4.2)
activesupport (= 7.0.4.2)
activesupport (7.0.4.2)
activemodel (7.0.8)
activesupport (= 7.0.8)
activesupport (7.0.8)
concurrent-ruby (~> 1.0, >= 1.0.2)
i18n (>= 1.6, < 2)
minitest (>= 5.1)
tzinfo (~> 2.0)
builder (3.2.4)
concurrent-ruby (1.2.0)
countries (5.3.1)
concurrent-ruby (1.2.2)
countries (5.7.0)
unaccent (~> 0.3)
country_select (8.0.1)
country_select (8.0.3)
countries (~> 5.0)
crass (1.0.6)
erubi (1.12.0)
i18n (1.12.0)
i18n (1.14.1)
concurrent-ruby (~> 1.0)
loofah (2.19.1)
loofah (2.21.4)
crass (~> 1.0.2)
nokogiri (>= 1.5.9)
nokogiri (>= 1.12.0)
method_source (1.0.0)
mini_portile2 (2.8.1)
minitest (5.17.0)
nokogiri (1.14.0)
mini_portile2 (~> 2.8.0)
mini_portile2 (2.8.4)
minitest (5.20.0)
nokogiri (1.15.4)
mini_portile2 (~> 2.8.2)
racc (~> 1.4)
racc (1.6.2)
rack (2.2.6.2)
rack-test (2.0.2)
racc (1.7.1)
rack (2.2.8)
rack-test (2.1.0)
rack (>= 1.3)
rails-dom-testing (2.0.3)
activesupport (>= 4.2.0)
rails-dom-testing (2.2.0)
activesupport (>= 5.0.0)
minitest
nokogiri (>= 1.6)
rails-html-sanitizer (1.5.0)
loofah (~> 2.19, >= 2.19.1)
railties (7.0.4.2)
actionpack (= 7.0.4.2)
activesupport (= 7.0.4.2)
rails-html-sanitizer (1.6.0)
loofah (~> 2.21)
nokogiri (~> 1.14)
railties (7.0.8)
actionpack (= 7.0.8)
activesupport (= 7.0.8)
method_source
rake (>= 12.2)
thor (~> 1.0)
zeitwerk (~> 2.5)
rake (13.0.6)
thor (1.2.1)
thor (1.2.2)
tzinfo (2.0.6)
concurrent-ruby (~> 1.0)
unaccent (0.4.0)
zeitwerk (2.6.6)
zeitwerk (2.6.12)

PLATFORMS
ruby
Expand Down
6 changes: 3 additions & 3 deletions test/form_builder/association_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def with_association_for(object, *args)
end

test 'builder preloads collection association' do
value = @user.tags = MiniTest::Mock.new
value = @user.tags = Minitest::Mock.new
value.expect(:to_a, value)

with_association_for @user, :tags
Expand All @@ -61,7 +61,7 @@ def with_association_for(object, *args)
end

test 'builder does not preload collection association if preload is false' do
value = @user.tags = MiniTest::Mock.new
value = @user.tags = Minitest::Mock.new
value.expect(:to_a, nil)

with_association_for @user, :tags, preload: false
Expand All @@ -76,7 +76,7 @@ def with_association_for(object, *args)
end

test 'builder does not preload non-collection association' do
value = @user.company = MiniTest::Mock.new
value = @user.company = Minitest::Mock.new
value.expect(:to_a, nil)

with_association_for @user, :company
Expand Down
6 changes: 1 addition & 5 deletions test/test_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,7 @@ def self.env

require 'country_select'

if defined?(HTMLSelector::NO_STRIP)
HTMLSelector::NO_STRIP << "label"
else
ActionDispatch::Assertions::NO_STRIP << "label"
end
Rails::Dom::Testing::Assertions::SelectorAssertions::HTMLSelector::NO_STRIP << "label"

if ActiveSupport::TestCase.respond_to?(:test_order=)
ActiveSupport::TestCase.test_order = :random
Expand Down

0 comments on commit b9ba1ce

Please sign in to comment.