rails setup
This commit is contained in:
17
test/services/app_config_test.rb
Normal file
17
test/services/app_config_test.rb
Normal file
@ -0,0 +1,17 @@
|
||||
require 'test_helper'
|
||||
|
||||
class AppConfigTest < ActiveSupport::TestCase
|
||||
test "verify sample file exists" do
|
||||
assert File.exist? "#{Rails.root}/config/application.yml.sample"
|
||||
end
|
||||
|
||||
test "verify config file exists" do
|
||||
assert File.exist? "#{Rails.root}/config/application.yml"
|
||||
end
|
||||
|
||||
test 'config can load and return proper values' do
|
||||
config = AppConfig.new
|
||||
|
||||
assert_equal 'localhost', config.mysql_host
|
||||
end
|
||||
end
|
@ -1,10 +1,23 @@
|
||||
ENV['RAILS_ENV'] ||= 'test'
|
||||
|
||||
# https://github.com/colszowka/simplecov
|
||||
require 'simplecov'
|
||||
SimpleCov.start 'rails' do
|
||||
add_group 'Models', %w(app/models app/validators)
|
||||
add_group 'PORO', %w(app/services)
|
||||
end
|
||||
|
||||
require File.expand_path('../../config/environment', __FILE__)
|
||||
require 'rails/test_help'
|
||||
require "minitest/autorun"
|
||||
require 'minitest/reporters'
|
||||
Dir[Rails.root.join("test/test_helpers/**/*.rb")].each { |f| require f }
|
||||
|
||||
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
|
||||
|
Reference in New Issue
Block a user