Permalink
Browse files

sql server 2000 doesn't contain a sys.view table - fix broken test

  • Loading branch information...
1 parent 895378b commit 328c17e64f7023679ccddf8eed149ab2275839f6 @gregors gregors committed May 13, 2012
Showing with 7 additions and 2 deletions.
  1. +7 −2 test/mssql_ignore_system_views_test.rb
@@ -8,8 +8,13 @@ class IgnoreSystemViewsTest < Test::Unit::TestCase
include MigrationSetup
def test_system_views_ignored
- assert_equal true, table_exists?("sys.views"), %{table_exists?("sys.views")}
- assert_equal true, table_exists?("information_schema.views"), %{table_exists?("information_schema.views")}
+ if ActiveRecord::Base.connection.sqlserver_version == "2000"
+ assert_equal false, table_exists?("sys.views"), %{table_exists?("sys.views")}
+ assert_equal false, table_exists?("information_schema.views"), %{table_exists?("information_schema.views")}
+ else
+ assert_equal true, table_exists?("sys.views"), %{table_exists?("sys.views")}
+ assert_equal true, table_exists?("information_schema.views"), %{table_exists?("information_schema.views")}
+ end
assert_equal false, table_exists?("dbo.views"), %{table_exists?("dbo.views")}
assert_equal false, table_exists?(:views), %{table_exists?(:views)}
ActiveRecord::Schema.define { suppress_messages { create_table :views } }

0 comments on commit 328c17e

Please sign in to comment.