diff --git a/.travis.yml b/.travis.yml index 2f0c67127..9a5f1771a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,7 +5,7 @@ env: - "RAILS_VERSION=5.0.7.2" - "RAILS_VERSION=5.1.7" - "RAILS_VERSION=5.2.3" -# - "RAILS_VERSION=6.0.0.beta1" + - "RAILS_VERSION=6.0.0" # - "RAILS_VERSION=master" rvm: - 2.3.8 @@ -19,5 +19,9 @@ matrix: exclude: - rvm: 2.6.4 env: "RAILS_VERSION=4.2.11" + - rvm: 2.3.8 + env: "RAILS_VERSION=6.0.0" + - rvm: 2.4.7 + env: "RAILS_VERSION=6.0.0" before_install: - - gem install bundler --version 1.17.3 \ No newline at end of file + - gem install bundler --version 1.17.3 diff --git a/Gemfile b/Gemfile index c58d1c896..f08ca7961 100644 --- a/Gemfile +++ b/Gemfile @@ -2,22 +2,26 @@ source 'https://rubygems.org' gemspec -platforms :ruby do - gem 'sqlite3', '1.3.10' -end - platforms :jruby do gem 'activerecord-jdbcsqlite3-adapter' end version = ENV['RAILS_VERSION'] || 'default' +platforms :ruby do + if version.start_with?('4.2', '5.0') + gem 'sqlite3', '~> 1.3.13' + else + gem 'sqlite3', '~> 1.4' + end +end + case version when 'master' gem 'railties', { git: 'https://github.com/rails/rails.git' } gem 'arel', { git: 'https://github.com/rails/arel.git' } when 'default' - gem 'railties', '>= 5.0' + gem 'railties', '>= 6.0' else gem 'railties', "~> #{version}" end diff --git a/test/test_helper.rb b/test/test_helper.rb index 8fe8f32c6..8f8ba5a1f 100644 --- a/test/test_helper.rb +++ b/test/test_helper.rb @@ -470,7 +470,8 @@ class ActionDispatch::IntegrationTest fixtures :all def assert_jsonapi_response(expected_status, msg = nil) - assert_equal JSONAPI::MEDIA_TYPE, response.content_type + media_type = Rails::VERSION::MAJOR >= 6 ? response.media_type : response.content_type + assert_equal JSONAPI::MEDIA_TYPE, media_type if status != expected_status && status >= 400 pp json_response rescue nil end