summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorAzul <azul@riseup.net>2015-09-10 08:17:18 +0200
committerAzul <azul@riseup.net>2015-09-10 08:22:26 +0200
commitbdefeafe150123b7f186dda13366e7a1d7dc53ed (patch)
tree3685e8c8da24fdfa62a9a09a7b0d82e615c49cf6 /test
parent8e25ce5e54d13a8bb52a8c209e47b5a9a945f61a (diff)
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.
Diffstat (limited to 'test')
-rw-r--r--test/unit/user_test.rb5
1 files changed, 5 insertions, 0 deletions
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"