Skip to content
This repository
Browse code

Merge pull request #195 from gregors/view_sys_mssql_2000

sql server 2000 doesn't contain a sys.view table - fix broken test
  • Loading branch information...
commit e49ec53fb369c5b664bcfc577e1bec84d45c0070 2 parents 895378b + 328c17e
Guillermo Iguaran guilleiguaran authored

Showing 1 changed file with 7 additions and 2 deletions. Show diff stats Hide diff stats

  1. +7 2 test/mssql_ignore_system_views_test.rb
9 test/mssql_ignore_system_views_test.rb
@@ -8,8 +8,13 @@ class IgnoreSystemViewsTest < Test::Unit::TestCase
8 8 include MigrationSetup
9 9
10 10 def test_system_views_ignored
11   - assert_equal true, table_exists?("sys.views"), %{table_exists?("sys.views")}
12   - assert_equal true, table_exists?("information_schema.views"), %{table_exists?("information_schema.views")}
  11 + if ActiveRecord::Base.connection.sqlserver_version == "2000"
  12 + assert_equal false, table_exists?("sys.views"), %{table_exists?("sys.views")}
  13 + assert_equal false, table_exists?("information_schema.views"), %{table_exists?("information_schema.views")}
  14 + else
  15 + assert_equal true, table_exists?("sys.views"), %{table_exists?("sys.views")}
  16 + assert_equal true, table_exists?("information_schema.views"), %{table_exists?("information_schema.views")}
  17 + end
13 18 assert_equal false, table_exists?("dbo.views"), %{table_exists?("dbo.views")}
14 19 assert_equal false, table_exists?(:views), %{table_exists?(:views)}
15 20 ActiveRecord::Schema.define { suppress_messages { create_table :views } }

0 comments on commit e49ec53

Please sign in to comment.
Something went wrong with that request. Please try again.