cirandas.net

ref: master

plugins/display_content/test/test_helper.rb


 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
require_relative "../../../test/test_helper"

def sort_by_data(array)
  return if array.blank?
  array.each {|el| el['children'] = sort_by_data(el['children']) }
  array.sort_by {|el| el['data']}
end

def assert_hash_equivalent(expected, response)
  assert_equal sort_by_data(expected), sort_by_data(response)
end