36 lines
771 B
Ruby
36 lines
771 B
Ruby
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
|