Seems that order of an inner array can change causing test failures. You can use the have_same_elements
RSpec matcher to make the check order independent.
1) OpsController OpsController::Settings::Common SmartProxy Affinity #build_smartproxy_affinity_tree should build a SmartProxy Affinity tree
Failure/Error: tree.should be == [
expected: == [{:key=>"1166", :icon=>"evm_server.png", :title=>"Server: svr1 [1166]", :expand=>true, :children=>[{:key=>"1166__host", :icon=>"host.png", :title=>"Hosts", :children=>[{:key=>"1166__host_978", :icon=>"host.png", :title=>"host1", :select=>true}, {:key=>"1166__host_979", :icon=>"host.png", :title=>"host2", :select=>false}]}, {:key=>"1166__storage", :icon=>"storage.png", :title=>"Datastores", :children=>[{:key=>"1166__storage_401", :icon=>"storage.png", :title=>"storage_99", :select=>true}, {:key=>"1166__storage_402", :icon=>"storage.png", :title=>"storage_100", :select=>false}]}]}, {:key=>"1167", :icon=>"evm_server.png", :title=>"Server: svr2 [1167]", :expand=>true, :children=>[{:key=>"1167__host", :icon=>"host.png", :title=>"Hosts", :children=>[{:key=>"1167__host_978", :icon=>"host.png", :title=>"host1", :select=>false}, {:key=>"1167__host_979", :icon=>"host.png", :title=>"host2", :select=>true}]}, {:key=>"1167__storage", :icon=>"storage.png", :title=>"Datastores", :children=>[{:key=>"1167__storage_401", :icon=>"storage.png", :title=>"storage_99", :select=>false}, {:key=>"1167__storage_402", :icon=>"storage.png", :title=>"storage_100", :select=>true}]}]}]
got: [{:key=>"1166", :icon=>"evm_server.png", :title=>"Server: svr1 [1166]", :expand=>true, :children=>[{:key=>"1166__host", :icon=>"host.png", :title=>"Hosts", :children=>[{:key=>"1166__host_978", :icon=>"host.png", :title=>"host1", :select=>true}, {:key=>"1166__host_979", :icon=>"host.png", :title=>"host2", :select=>false}]}, {:key=>"1166__storage", :icon=>"storage.png", :title=>"Datastores", :children=>[{:key=>"1166__storage_402", :icon=>"storage.png", :title=>"storage_100", :select=>false}, {:key=>"1166__storage_401", :icon=>"storage.png", :title=>"storage_99", :select=>true}]}]}, {:key=>"1167", :icon=>"evm_server.png", :title=>"Server: svr2 [1167]", :expand=>true, :children=>[{:key=>"1167__host", :icon=>"host.png", :title=>"Hosts", :children=>[{:key=>"1167__host_978", :icon=>"host.png", :title=>"host1", :select=>false}, {:key=>"1167__host_979", :icon=>"host.png", :title=>"host2", :select=>true}]}, {:key=>"1167__storage", :icon=>"storage.png", :title=>"Datastores", :children=>[{:key=>"1167__storage_402", :icon=>"storage.png", :title=>"storage_100", :select=>true}, {:key=>"1167__storage_401", :icon=>"storage.png", :title=>"storage_99", :select=>false}]}]}]
# /home/travis/.rvm/gems/ruby-1.9.3-p545/gems/rspec-expectations-2.12.1/lib/rspec/expectations/fail_with.rb:33:in `fail_with'
# /home/travis/.rvm/gems/ruby-1.9.3-p545/gems/rspec-expectations-2.12.1/lib/rspec/expectations/handler.rb:33:in `handle_matcher'
# /home/travis/.rvm/gems/ruby-1.9.3-p545/gems/rspec-expectations-2.12.1/lib/rspec/expectations/syntax.rb:53:in `should'
# ./spec/controllers/ops_controller/settings/common_spec.rb:48:in `block (5 levels) in <top (required)>'
# /home/travis/.rvm/gems/ruby-1.9.3-p545/gems/rspec-core-2.12.2/lib/rspec/core/example.rb:114:in `instance_eval'
# /home/travis/.rvm/gems/ruby-1.9.3-p545/gems/rspec-core-2.12.2/lib/rspec/core/example.rb:114:in `block in run'
# /home/travis/.rvm/gems/ruby-1.9.3-p545/gems/rspec-core-2.12.2/lib/rspec/core/example.rb:254:in `with_around_each_hooks'
# /home/travis/.rvm/gems/ruby-1.9.3-p545/gems/rspec-core-2.12.2/lib/rspec/core/example.rb:111:in `run'
# /home/travis/.rvm/gems/ruby-1.9.3-p545/gems/rspec-core-2.12.2/lib/rspec/core/example_group.rb:388:in `block in run_examples'
# /home/travis/.rvm/gems/ruby-1.9.3-p545/gems/rspec-core-2.12.2/lib/rspec/core/example_group.rb:384:in `map'
# /home/travis/.rvm/gems/ruby-1.9.3-p545/gems/rspec-core-2.12.2/lib/rspec/core/example_group.rb:384:in `run_examples'
# /home/travis/.rvm/gems/ruby-1.9.3-p545/gems/rspec-core-2.12.2/lib/rspec/core/example_group.rb:369:in `run'
# /home/travis/.rvm/gems/ruby-1.9.3-p545/gems/rspec-core-2.12.2/lib/rspec/core/example_group.rb:370:in `block in run'
# /home/travis/.rvm/gems/ruby-1.9.3-p545/gems/rspec-core-2.12.2/lib/rspec/core/example_group.rb:370:in `map'
# /home/travis/.rvm/gems/ruby-1.9.3-p545/gems/rspec-core-2.12.2/lib/rspec/core/example_group.rb:370:in `run'
# /home/travis/.rvm/gems/ruby-1.9.3-p545/gems/rspec-core-2.12.2/lib/rspec/core/example_group.rb:370:in `block in run'
# /home/travis/.rvm/gems/ruby-1.9.3-p545/gems/rspec-core-2.12.2/lib/rspec/core/example_group.rb:370:in `map'
# /home/travis/.rvm/gems/ruby-1.9.3-p545/gems/rspec-core-2.12.2/lib/rspec/core/example_group.rb:370:in `run'
# /home/travis/.rvm/gems/ruby-1.9.3-p545/gems/rspec-core-2.12.2/lib/rspec/core/example_group.rb:370:in `block in run'
# /home/travis/.rvm/gems/ruby-1.9.3-p545/gems/rspec-core-2.12.2/lib/rspec/core/example_group.rb:370:in `map'
# /home/travis/.rvm/gems/ruby-1.9.3-p545/gems/rspec-core-2.12.2/lib/rspec/core/example_group.rb:370:in `run'
# /home/travis/.rvm/gems/ruby-1.9.3-p545/gems/rspec-core-2.12.2/lib/rspec/core/command_line.rb:28:in `block (2 levels) in run'
# /home/travis/.rvm/gems/ruby-1.9.3-p545/gems/rspec-core-2.12.2/lib/rspec/core/command_line.rb:28:in `map'
# /home/travis/.rvm/gems/ruby-1.9.3-p545/gems/rspec-core-2.12.2/lib/rspec/core/command_line.rb:28:in `block in run'
# /home/travis/.rvm/gems/ruby-1.9.3-p545/gems/rspec-core-2.12.2/lib/rspec/core/reporter.rb:34:in `report'
# /home/travis/.rvm/gems/ruby-1.9.3-p545/gems/rspec-core-2.12.2/lib/rspec/core/command_line.rb:25:in `run'
# /home/travis/.rvm/gems/ruby-1.9.3-p545/gems/rspec-core-2.12.2/lib/rspec/core/runner.rb:80:in `run'
# /home/travis/.rvm/gems/ruby-1.9.3-p545/gems/rspec-core-2.12.2/lib/rspec/core/runner.rb:17:in `block in autorun'