Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fix AV::FixtureResolver and rjs tests with random order errors

Due to the hash ordering changes on Ruby 1.8.7-p358.
  • Loading branch information...
commit 9698312704017d634cebe48e9ca06042b3d549c5 1 parent 00726ea
Carlos Antonio da Silva carlosantoniodasilva authored
9 actionpack/lib/action_view/testing/resolvers.rb
View
@@ -22,10 +22,11 @@ def query(path, exts, formats)
end
templates = []
- @hash.select { |k,v| k =~ /^#{query}$/ }.each do |path, source|
- handler, format = extract_handler_and_format(path, formats)
- templates << Template.new(source, path, handler,
- :virtual_path => path, :format => format)
+ @hash.each do |_path, source|
+ next unless _path =~ /^#{query}$/
+ handler, format = extract_handler_and_format(_path, formats)
+ templates << Template.new(source, _path, handler,
+ :virtual_path => _path, :format => format)
end
templates.sort_by {|t| -t.identifier.match(/^#{query}$/).captures.reject(&:blank?).size }
24 actionpack/test/controller/new_base/render_rjs_test.rb
View
@@ -4,18 +4,18 @@ module RenderRjs
class BasicController < ActionController::Base
layout "application", :only => :index_respond_to
- self.view_paths = [ActionView::FixtureResolver.new(
- "layouts/application.html.erb" => "",
- "render_rjs/basic/index.js.rjs" => "page[:customer].replace_html render(:partial => 'customer')",
- "render_rjs/basic/index_html.js.rjs" => "page[:customer].replace_html :partial => 'customer'",
- "render_rjs/basic/index_no_js.js.erb" => "<%= render(:partial => 'developer') %>",
- "render_rjs/basic/_customer.js.erb" => "JS Partial",
- "render_rjs/basic/_customer.html.erb" => "HTML Partial",
- "render_rjs/basic/_developer.html.erb" => "HTML Partial",
- "render_rjs/basic/index_locale.js.rjs" => "page[:customer].replace_html :partial => 'customer'",
- "render_rjs/basic/_customer.da.html.erb" => "Danish HTML Partial",
- "render_rjs/basic/_customer.da.js.erb" => "Danish JS Partial"
- )]
+ self.view_paths = [ActionView::FixtureResolver.new(ActiveSupport::OrderedHash[
+ "layouts/application.html.erb" , "",
+ "render_rjs/basic/index.js.rjs" , "page[:customer].replace_html render(:partial => 'customer')",
+ "render_rjs/basic/index_html.js.rjs" , "page[:customer].replace_html :partial => 'customer'",
+ "render_rjs/basic/index_no_js.js.erb" , "<%= render(:partial => 'developer') %>",
+ "render_rjs/basic/_customer.js.erb" , "JS Partial",
+ "render_rjs/basic/_customer.html.erb" , "HTML Partial",
+ "render_rjs/basic/_developer.html.erb" , "HTML Partial",
+ "render_rjs/basic/index_locale.js.rjs" , "page[:customer].replace_html :partial => 'customer'",
+ "render_rjs/basic/_customer.da.html.erb" , "Danish HTML Partial",
+ "render_rjs/basic/_customer.da.js.erb" , "Danish JS Partial"
+ ])]
def index
render
Please sign in to comment.
Something went wrong with that request. Please try again.