File tree Expand file tree Collapse file tree 1 file changed +16
-0
lines changed
Expand file tree Collapse file tree 1 file changed +16
-0
lines changed Original file line number Diff line number Diff line change @@ -114,5 +114,21 @@ def test_find_by_sql_WITH_statement
114114 assert_equal db . id , connection . last_insert_id
115115 #assert_equal e.id, connection.last_insert_id('entries')
116116 end
117+
118+ # DB2 does not like "= NULL".
119+ def test_equals_null
120+ Entry . create! ( :title => "Foo" )
121+ entry = Entry . find ( :first , :conditions => [ "content = NULL" ] )
122+ assert_equal "Foo" , entry . title
123+ end
124+
125+ # DB2 does not like "!= NULL" or "<> NULL".
126+ def test_not_equals_null
127+ Entry . create! ( :title => "Foo" , :content => "Bar" )
128+ entry = Entry . find_by_title ( "Foo" , :conditions => [ "content != NULL" ] )
129+ assert_equal "Foo" , entry . title
130+ entry = Entry . find_by_title ( "Foo" , :conditions => [ "content <> NULL" ] )
131+ assert_equal "Foo" , entry . title
132+ end
117133
118134end
You can’t perform that action at this time.
0 commit comments