From bdefeafe150123b7f186dda13366e7a1d7dc53ed Mon Sep 17 00:00:00 2001 From: Azul Date: Thu, 10 Sep 2015 08:17:18 +0200 Subject: couchrest_model 2.0.1 fixes find_by_sth(nil) This used to return the first record! :scream: This [commit](https://github.com/couchrest/couchrest_model/commit/2c5b76823e94caed4d8cbfbf18cb9e0d58789789) is essential for say User.find_by_login(nil) to NOT return the first record in the database. --- test/unit/user_test.rb | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'test') diff --git a/test/unit/user_test.rb b/test/unit/user_test.rb index b3c831b..c301923 100644 --- a/test/unit/user_test.rb +++ b/test/unit/user_test.rb @@ -7,6 +7,11 @@ class UserTest < ActiveSupport::TestCase @user = FactoryGirl.build(:user) end + test "don't find a user with login nil" do + @user.save + assert_nil User.find_by_login(nil) + end + test "design docs in database are authorative" do assert !User.design_doc.auto_update, "Automatic update of design docs should be disabled" -- cgit v1.2.3