Fixed test helper.
This commit is contained in:
parent
19bb9415ed
commit
e11f82f7d2
1 changed files with 3 additions and 7 deletions
|
@ -143,21 +143,17 @@ class SessionCollectionsTest < ActiveSupport::TestCase
|
||||||
if result[:collection] && result[:collection][collection]
|
if result[:collection] && result[:collection][collection]
|
||||||
|
|
||||||
# check just if collection exists
|
# check just if collection exists
|
||||||
if !attributes
|
return true if !attributes
|
||||||
return true
|
|
||||||
end
|
|
||||||
|
|
||||||
# check if objetc with attributes in collection exists
|
# check if objetc with attributes in collection exists
|
||||||
result[:collection][collection].each {|item|
|
result[:collection][collection].each {|item|
|
||||||
match_all = true
|
match_all = true
|
||||||
attributes.each {|key, value|
|
attributes.each {|key, value|
|
||||||
if item.attributes_with_associations[ key.to_s ] != value
|
if item[ key.to_s ] != value
|
||||||
match_all = false
|
match_all = false
|
||||||
end
|
end
|
||||||
}
|
}
|
||||||
if match_all
|
return true if match_all
|
||||||
return true
|
|
||||||
end
|
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue