Skip to content

Commit b5190d4

Browse files
committed
Fixed namespacing
1 parent d7bc646 commit b5190d4

File tree

1 file changed

+20
-18
lines changed

1 file changed

+20
-18
lines changed

test/cases/coerced_tests.rb

Lines changed: 20 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -49,24 +49,26 @@ def test_value_limit_violations_are_translated_to_specific_exception_coerced
4949
end
5050
end
5151

52-
# SQL Server does not allow truncation of tables that are referenced by foreign key
53-
# constraints. So manually remove/add foreign keys in test.
54-
coerce_tests! test_truncate_tables
55-
def test_truncate_tables_coerced
56-
@connection.remove_foreign_key :authors, :author_addresses
57-
58-
assert_operator Post.count, :>, 0
59-
assert_operator Author.count, :>, 0
60-
assert_operator AuthorAddress.count, :>, 0
61-
62-
@connection.truncate_tables("author_addresses", "authors", "posts")
63-
64-
assert_equal 0, Post.count
65-
assert_equal 0, Author.count
66-
assert_equal 0, AuthorAddress.count
67-
ensure
68-
@connection.add_foreign_key :authors, :author_addresses
69-
reset_fixtures("posts", "authors", "author_addresses")
52+
class AdapterTestWithoutTransaction
53+
# SQL Server does not allow truncation of tables that are referenced by foreign key
54+
# constraints. So manually remove/add foreign keys in test.
55+
coerce_tests! test_truncate_tables
56+
def test_truncate_tables_coerced
57+
@connection.remove_foreign_key :authors, :author_addresses
58+
59+
assert_operator Post.count, :>, 0
60+
assert_operator Author.count, :>, 0
61+
assert_operator AuthorAddress.count, :>, 0
62+
63+
@connection.truncate_tables("author_addresses", "authors", "posts")
64+
65+
assert_equal 0, Post.count
66+
assert_equal 0, Author.count
67+
assert_equal 0, AuthorAddress.count
68+
ensure
69+
@connection.add_foreign_key :authors, :author_addresses
70+
reset_fixtures("posts", "authors", "author_addresses")
71+
end
7072
end
7173
end
7274
end

0 commit comments

Comments
 (0)