@@ -1941,37 +1941,29 @@ def index
19411941 assert_equal ( { } , Rails . application . config . my_custom_config )
19421942 end
19431943
1944- test "default SQLite3Adapter. represent_boolean_as_integer for 5.1 is false " do
1944+ test "represent_boolean_as_integer is deprecated " do
19451945 remove_from_config '.*config\.load_defaults.*\n'
19461946
1947- app_file "app/models/post.rb" , <<-RUBY
1948- class Post < ActiveRecord::Base
1949- end
1947+ app_file "config/initializers/new_framework_defaults_6_0.rb" , <<-RUBY
1948+ Rails.application.config.active_record.sqlite3.represent_boolean_as_integer = true
19501949 RUBY
19511950
1952- app "development"
1953- force_lazy_load_hooks { Post }
1954-
1955- assert_not ActiveRecord ::ConnectionAdapters ::SQLite3Adapter . represent_boolean_as_integer
1956- end
1957-
1958- test "default SQLite3Adapter.represent_boolean_as_integer for new installs is true" do
19591951 app_file "app/models/post.rb" , <<-RUBY
19601952 class Post < ActiveRecord::Base
19611953 end
19621954 RUBY
19631955
19641956 app "development"
1965- force_lazy_load_hooks { Post }
1966-
1967- assert ActiveRecord :: ConnectionAdapters :: SQLite3Adapter . represent_boolean_as_integer
1957+ assert_deprecated do
1958+ force_lazy_load_hooks { Post }
1959+ end
19681960 end
19691961
1970- test "represent_boolean_as_integer should be able to set via config.active_record.sqlite3.represent_boolean_as_integer " do
1962+ test "represent_boolean_as_integer raises when the value is false " do
19711963 remove_from_config '.*config\.load_defaults.*\n'
19721964
19731965 app_file "config/initializers/new_framework_defaults_6_0.rb" , <<-RUBY
1974- Rails.application.config.active_record.sqlite3.represent_boolean_as_integer = true
1966+ Rails.application.config.active_record.sqlite3.represent_boolean_as_integer = false
19751967 RUBY
19761968
19771969 app_file "app/models/post.rb" , <<-RUBY
@@ -1980,9 +1972,9 @@ class Post < ActiveRecord::Base
19801972 RUBY
19811973
19821974 app "development"
1983- force_lazy_load_hooks { Post }
1984-
1985- assert ActiveRecord :: ConnectionAdapters :: SQLite3Adapter . represent_boolean_as_integer
1975+ assert_raises ( RuntimeError ) do
1976+ force_lazy_load_hooks { Post }
1977+ end
19861978 end
19871979
19881980 test "config_for containing ERB tags should evaluate" do
0 commit comments