Sha256: 7489d8b9fd300f3df501fea65f352530d1e12b4f807cdd55fe73a1d80846dbff

Contents?: true

Size: 1 KB

Versions: 4

Compression:

Stored size: 1 KB

Contents

require File.dirname(__FILE__) + '/../test_helper'

class SysConfigTest < Test::Unit::TestCase
  fixtures :sys_configs

  def setup
      @testconfig = @loaded_fixtures["sys_configs"]
  end

  # Replace this with your real tests.
  def test_truth
    assert true
  end

  def test_param_not_found
      assert_raises ActiveRecord::RecordNotFound do
          SysConfig.nosuchparam
      end
  end

  def test_fixture_retrieval
      assert_equal @testconfig["smtpserver"]["value"], SysConfig.smtpserver
      assert_equal @testconfig["smtpport"]["value"],
          SysConfig.smtpport
  end

  def test_set_new_simple_param
      assert_equal 42, SysConfig.test1=42
      assert_equal 42, SysConfig.test1

      assert_equal "test", SysConfig.test2="test"
      assert_equal "test", SysConfig.test2
  end

  def test_old_activerecord_functionality
      assert_nothing_raised do
          param = SysConfig.find_by_name "smtpserver"
          assert_equal @testconfig["smtpserver"]["value"], param.value
      end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
sugoi-mail-0.0.5 test/unit/sys_config_test.rb
sugoi-mail-0.0.3 test/unit/sys_config_test.rb
sugoi-mail-0.1.0 test/unit/sys_config_test.rb
sugoi-mail-0.0.2 test/unit/sys_config_test.rb