diff options
Diffstat (limited to 'actionpack/lib/action_dispatch/testing')
3 files changed, 5 insertions, 5 deletions
diff --git a/actionpack/lib/action_dispatch/testing/assertions/routing.rb b/actionpack/lib/action_dispatch/testing/assertions/routing.rb index 9210bffd1d..496682e8bd 100644 --- a/actionpack/lib/action_dispatch/testing/assertions/routing.rb +++ b/actionpack/lib/action_dispatch/testing/assertions/routing.rb @@ -81,7 +81,7 @@ module ActionDispatch          # Load routes.rb if it hasn't been loaded.          generated_path, extra_keys = @routes.generate_extras(options, defaults) -        found_extras = options.reject {|k, v| ! extra_keys.include? k} +        found_extras = options.reject { |k, _| ! extra_keys.include? k }          msg = message || sprintf("found extras <%s>, not <%s>", found_extras, extras)          assert_equal(extras, found_extras, msg) @@ -120,7 +120,7 @@ module ActionDispatch            options[:controller] = "/#{controller}"          end -        generate_options = options.dup.delete_if{ |k,v| defaults.key?(k) } +        generate_options = options.dup.delete_if{ |k, _| defaults.key?(k) }          assert_generates(path.is_a?(Hash) ? path[:path] : path, generate_options, defaults, extras, message)        end diff --git a/actionpack/lib/action_dispatch/testing/assertions/selector.rb b/actionpack/lib/action_dispatch/testing/assertions/selector.rb index e481f3b245..3253a3d424 100644 --- a/actionpack/lib/action_dispatch/testing/assertions/selector.rb +++ b/actionpack/lib/action_dispatch/testing/assertions/selector.rb @@ -377,8 +377,8 @@ module ActionDispatch            node.content.gsub(/<!\[CDATA\[(.*)(\]\]>)?/m) { Rack::Utils.escapeHTML($1) }          end -        selected = elements.map do |_element| -          text = _element.children.select{ |c| not c.tag? }.map{ |c| fix_content[c] }.join +        selected = elements.map do |elem| +          text = elem.children.select{ |c| not c.tag? }.map{ |c| fix_content[c] }.join            root = HTML::Document.new(CGI.unescapeHTML("<encoded>#{text}</encoded>")).root            css_select(root, "encoded:root", &block)[0]          end diff --git a/actionpack/lib/action_dispatch/testing/test_process.rb b/actionpack/lib/action_dispatch/testing/test_process.rb index e657283cec..630e6a9b78 100644 --- a/actionpack/lib/action_dispatch/testing/test_process.rb +++ b/actionpack/lib/action_dispatch/testing/test_process.rb @@ -6,7 +6,7 @@ module ActionDispatch    module TestProcess      def assigns(key = nil)        assigns = {}.with_indifferent_access -      @controller.view_assigns.each {|k, v| assigns.regular_writer(k, v)} +      @controller.view_assigns.each { |k, v| assigns.regular_writer(k, v) }        key.nil? ? assigns : assigns[key]      end  | 
