This commit is contained in:
2015-09-12 15:37:05 -05:00
commit cb7e47a466
77 changed files with 1374 additions and 0 deletions

0
test/controllers/.keep Normal file
View File

View File

@ -0,0 +1,7 @@
require 'test_helper'
class ChildrenControllerTest < ActionController::TestCase
# test "the truth" do
# assert true
# end
end

View File

@ -0,0 +1,7 @@
require 'test_helper'
class DocsControllerTest < ActionController::TestCase
def test_root
xhr :get, :index
assert response.ok?
end
end

View File

@ -0,0 +1,7 @@
require 'test_helper'
class PagesControllerTest < ActionController::TestCase
# test "the truth" do
# assert true
# end
end

View File

@ -0,0 +1,8 @@
require 'test_helper'
class ParentsControllerTest < ActionController::TestCase
def test_parents
xhr :get, :index
assert response.ok?
end
end

View File

@ -0,0 +1,7 @@
require 'test_helper'
class StaffControllerTest < ActionController::TestCase
# test "the truth" do
# assert true
# end
end

View File

@ -0,0 +1,7 @@
require 'test_helper'
class UsersControllerTest < ActionController::TestCase
# test "the truth" do
# assert true
# end
end

0
test/fixtures/.keep vendored Normal file
View File

10
test/fixtures/child.yml vendored Normal file
View File

@ -0,0 +1,10 @@
---
kyle:
first_name: Kyle
last_name: Kerfer
sally:
first_name: Sally
last_name: Smith
nemo:
first_name: Nemo
last_name: Smith

44
test/fixtures/person.yml vendored Normal file
View File

@ -0,0 +1,44 @@
---
admin:
first_name: admin
last_name: user
email: admin.user@mailinator.com
phone: 5005550006
admin: true
basic:
first_name: basic
last_name: user
email: basic.user@mailinator.com
phone: 5005550001
staff: true
wanda:
first_name: Wanda
last_name: Worker
email: wonda.worker@mailinator.com
phone: 5005550006
staff: true
steve:
first_name: Steve
last_name: Worker
email: steve.worker@mailinator.com
phone: 5005550006
staff: true
kimmy:
first_name: Kimmy
last_name: Kerfer
email: kimmy.kerfer@mailinator.com
phone: 5005550006
staff: true
children: kyle
marlin:
first_name: Marlin
last_name: Smith
email: marlin.smith@mailinator.com
phone: 5005550006
children: sally, nemo
sarah:
first_name: Sarah
last_name: Smith
email: marlin.smith@mailinator.com
phone: 5005550006
children: sally, nemo

0
test/helpers/.keep Normal file
View File

0
test/integration/.keep Normal file
View File

7
test/lib/secrets_test.rb Normal file
View File

@ -0,0 +1,7 @@
require File.expand_path '../../test_helper.rb', __FILE__
class SecretsTest < ActiveSupport::TestCase
def test_sanity
assert Secrets
end
end

0
test/mailers/.keep Normal file
View File

0
test/models/.keep Normal file
View File

View File

@ -0,0 +1,13 @@
require 'test_helper'
class PersonTest < ActiveSupport::TestCase
def test_sanity
assert Person
end
def test_parents
parents = Person.just_parents
assert parents.count > 1, "Did not find more than one parent"
end
end

35
test/smoke_test.rb Normal file
View File

@ -0,0 +1,35 @@
require 'test_helper'
class SmokeTest < ActiveSupport::TestCase
# include Rack::Test::Methods
# Here we are pretty much just checking that the database is
# rolling back transactions after each test run.
def test_db_reload
assert_empty Person.with_name('clean insert'), 'DB has not refreshed'
Person.create(
first_name: 'clean',
last_name: 'insert',
phone: '8885551212',
email: 'insert@mailinator.com'
)
refute_empty Person.with_name('clean insert'), 'person insert failed!'
end
def test_db_reload_2x
test_db_reload
end
def test_db_reload_3x
test_db_reload
end
def test_fixture_load
num_people = Person.all.count
assert num_people > 2, "Should have loaded more than 2 people"
end
end

15
test/test_helper.rb Normal file
View File

@ -0,0 +1,15 @@
ENV['RAILS_ENV'] ||= 'test'
require File.expand_path('../../config/environment', __FILE__)
require 'rails/test_help'
require "minitest/autorun"
require 'minitest/reporters'
Minitest::Reporters.use! [Minitest::Reporters::DefaultReporter.new(color: true)]
class ActiveSupport::TestCase
ActiveRecord::Migration.check_pending!
# Setup all fixtures in test/fixtures/*.yml for all tests in alphabetical order.
fixtures :all
# Add more helper methods to be used by all tests here...
end