Created
November 14, 2011 08:23
-
-
Save jpzwarte/1363520 to your computer and use it in GitHub Desktop.
Failing test
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1) Error: | |
test_coerced_test_delete_all_with_join(DeleteAllWithJoinTest): | |
ActiveRecord::StatementInvalid: TinyTds::Error: The multi-part identifier "posts.author_id" could not be bound.: EXEC sp_executesql N'DELETE FROM [people] WHERE [posts].[author_id] IS NULL; SELECT @@ROWCOUNT AS AffectedRows' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'cases/sqlserver_helper' | |
require 'models/person' | |
require 'models/post' | |
require 'models/reader' | |
class DeleteAllWithJoinTestSqlServer < ActiveRecord::TestCase | |
end | |
class DeleteAllWithJoinTest < ActiveRecord::TestCase | |
COERCED_TESTS = [:test_delete_all_with_join] | |
include SqlserverCoercedTest | |
fixtures :people, :readers, :posts | |
def test_coerced_test_delete_all_with_join | |
queries = assert_sql { Person.joins(:posts).where(:posts => { :author_id => nil }).delete_all } | |
puts queries.inspect | |
end | |
end | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment