test/indices.rb in ohm-1.0.0.rc1 vs test/indices.rb in ohm-1.0.0.rc2
- old
+ new
@@ -25,17 +25,17 @@
self.activation_code ||= "user:#{id}"
end
end
setup do
- @user1 = User.create(email: "foo", activation_code: "bar", update: "baz")
- @user2 = User.create(email: "bar")
- @user3 = User.create(email: "baz qux")
+ @user1 = User.create(:email => "foo", :activation_code => "bar", :update => "baz")
+ @user2 = User.create(:email => "bar")
+ @user3 = User.create(:email => "baz qux")
end
test "be able to find by the given attribute" do
- assert @user1 == User.find(email: "foo").first
+ assert @user1 == User.find(:email => "foo").first
end
test "raise an error if the parameter supplied is not a hash" do
begin
User.find(1)
@@ -45,10 +45,10 @@
assert ex.message == "You need to supply a hash with filters. If you want to find by ID, use User[id] instead."
end
end
test "avoid intersections with the all collection" do
- assert_equal "User:indices:email:foo", User.find(email: "foo").key
+ assert_equal "User:indices:email:foo", User.find(:email => "foo").key
end
test "cleanup the temporary key after use" do
assert User.find(:email => "foo", :activation_code => "bar").to_a