diff options
author | Matthew Draper <matthew@trebex.net> | 2017-07-12 23:21:07 +0930 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-07-12 23:21:07 +0930 |
commit | 58f10a31b37e9bb6e975a71aa63744f318ee043d (patch) | |
tree | 0c1fae69495ddfc24e4ad8fede784b4b5f4947fb /railties/test | |
parent | 21344061dc17151fe749b9dc76a127d597ec43ef (diff) | |
parent | 52e050ed00b023968fecda82f19a858876a7c435 (diff) | |
download | rails-58f10a31b37e9bb6e975a71aa63744f318ee043d.tar.gz rails-58f10a31b37e9bb6e975a71aa63744f318ee043d.tar.bz2 rails-58f10a31b37e9bb6e975a71aa63744f318ee043d.zip |
Merge pull request #29699 from lugray/represent_boolean_as_integer
Change sqlite3 boolean serialization to use 1 and 0
Diffstat (limited to 'railties/test')
-rw-r--r-- | railties/test/application/configuration_test.rb | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/railties/test/application/configuration_test.rb b/railties/test/application/configuration_test.rb index 6c0c087331..b8a19379e0 100644 --- a/railties/test/application/configuration_test.rb +++ b/railties/test/application/configuration_test.rb @@ -1585,6 +1585,34 @@ module ApplicationTests assert_equal({}, Rails.application.config.my_custom_config) end + test "default SQLite3Adapter.represent_boolean_as_integer for 5.1 is false" do + remove_from_config '.*config\.load_defaults.*\n' + add_to_top_of_config <<-RUBY + config.load_defaults 5.1 + RUBY + app_file "app/models/post.rb", <<-RUBY + class Post < ActiveRecord::Base + end + RUBY + + app "development" + Post.object_id # force lazy load hooks to run + + assert_not ActiveRecord::ConnectionAdapters::SQLite3Adapter.represent_boolean_as_integer + end + + test "default SQLite3Adapter.represent_boolean_as_integer for new installs is true" do + app_file "app/models/post.rb", <<-RUBY + class Post < ActiveRecord::Base + end + RUBY + + app "development" + Post.object_id # force lazy load hooks to run + + assert ActiveRecord::ConnectionAdapters::SQLite3Adapter.represent_boolean_as_integer + end + test "config_for containing ERB tags should evaluate" do app_file "config/custom.yml", <<-RUBY development: |