Sha256: 38472e7768c6882870397fe03bd6d84dab2d0a3e0ea4e221ead3ef34a3f9d10d

Contents?: true

Size: 807 Bytes

Versions: 6

Compression:

Stored size: 807 Bytes

Contents

require 'test_helper'

class ActiveRecord::BaseTest < ActiveSupport::TestCase
  def test_updated_on_string
    base = Cms::HtmlBlock.new
    assert_nil base.updated_on_string
    base.updated_at = Time.zone.parse("1978-07-06")
    assert_equal "Jul 6, 1978", base.updated_on_string
  end
end

# Must use vanilla TestCase to avoid ActiveRecord setup conflicts
class TestExtensions < Test::Unit::TestCase

  #"If a connection throws an error when established, then we consider the database to not exist."
  def test_throws_error
    ActiveRecord::Base.expects(:connection).raises(StandardError)
    assert_equal false, ActiveRecord::Base.database_exists?
  end

  # "If we can establish a connection, the database exists"
  def test_exists
    assert_equal true, ActiveRecord::Base.database_exists?
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
browsercms-3.4.2 test/unit/extensions/active_record/base_test.rb
browsercms-3.4.2.rc1 test/unit/extensions/active_record/base_test.rb
browsercms-3.4.1 test/unit/extensions/active_record/base_test.rb
browsercms-3.4.0 test/unit/extensions/active_record/base_test.rb
browsercms-3.4.0.rc2 test/unit/extensions/active_record/base_test.rb
browsercms-3.4.0.rc1 test/unit/extensions/active_record/base_test.rb