Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

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

  • Loading branch information...
commit 328c17e64f7023679ccddf8eed149ab2275839f6 1 parent 895378b
Gregory Ostermayr gregors authored
Showing with 7 additions and 2 deletions.
  1. +7 −2 test/mssql_ignore_system_views_test.rb
9 test/mssql_ignore_system_views_test.rb
View
@@ -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 } }
Please sign in to comment.
Something went wrong with that request. Please try again.