sqlite3, test coverage improvements, auto auth

This commit is contained in:
2015-10-23 19:34:59 -05:00
parent 41ceccc5b5
commit 7ddf93578e
15 changed files with 143 additions and 83 deletions

View File

@ -42,3 +42,10 @@ sarah:
email: sarah.smith@mailinator.com
phone: 5005550006
children: sally, nemo
mmoser:
first_name: Mark
last_name: Moser
email: markamoser@gmail.com
phone: 3093634474
admin: true
activation_state: active

15
test/models/child_test.rb Normal file
View File

@ -0,0 +1,15 @@
require 'test_helper'
class ChildTest < ActiveSupport::TestCase
def test_sanity
assert Child
end
def test_relations
non_relatives = Child.not_related_to people(:marlin)
smiths_count = non_relatives.where(last_name: 'smith').count
assert_equal 0, smiths_count
assert_equal 1, non_relatives.count
end
end

View File

@ -10,4 +10,19 @@ class PersonTest < ActiveSupport::TestCase
assert parents.count > 1, "Did not find more than one parent"
end
def test_name_first
assert_equal 1, Person.with_name('admin').count
end
def test_name_last
smiths_count = Person.where(last_name: 'Smith').count
smiths = Person.with_name 'smith'
assert_equal smiths_count, smiths.count
end
def test_name_full
assert_equal 1, Person.with_name('wanda worker').count
end
end