Merge pull request #1593 from internetee/upgrade-rails-to-6.0.3

Upgrade Rails from 5.2 to 6.0.3
This commit is contained in:
Timo Võhmar 2020-06-03 15:04:36 +03:00 committed by GitHub
commit 2ffe9629f9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
34 changed files with 272 additions and 112 deletions

View file

@ -13,7 +13,7 @@ class AdminAreaInvoicesIntegrationTest < ApplicationIntegrationTest
assert_response :ok
assert_equal 'application/pdf', response.headers['Content-Type']
assert_equal 'attachment; filename="invoice-1.pdf"', response.headers['Content-Disposition']
assert_equal "attachment; filename=\"invoice-1.pdf\"; filename*=UTF-8''invoice-1.pdf", response.headers['Content-Disposition']
assert_not_empty response.body
end
end
end

View file

@ -21,7 +21,7 @@ class AdminAreaZonesIntegrationTest < ApplicationIntegrationTest
assert_response :ok
assert_equal 'text/plain', response.headers['Content-Type']
assert_equal 'attachment; filename="test.txt"', response.headers['Content-Disposition']
assert_equal "attachment; filename=\"test.txt\"; filename*=UTF-8''test.txt", response.headers['Content-Disposition']
assert_not_empty response.body
end
end

View file

@ -10,7 +10,7 @@ class RegistrantAreaDomainsIntegrationTest < ApplicationIntegrationTest
assert_response :ok
assert_equal "#{Mime[:csv]}; charset=utf-8", response.headers['Content-Type']
assert_equal 'attachment; filename="domains.csv"', response.headers['Content-Disposition']
assert_equal "attachment; filename=\"domains.csv\"; filename*=UTF-8''domains.csv", response.headers['Content-Disposition']
assert_not_empty response.body
end
@ -19,7 +19,7 @@ class RegistrantAreaDomainsIntegrationTest < ApplicationIntegrationTest
assert_response :ok
assert_equal Mime[:pdf], response.headers['Content-Type']
assert_equal 'attachment; filename="domains.pdf"', response.headers['Content-Disposition']
assert_equal "attachment; filename=\"domains.pdf\"; filename*=UTF-8''domains.pdf", response.headers['Content-Disposition']
assert_not_empty response.body
end
end

View file

@ -10,7 +10,7 @@ class RegistrarAreaContactsIntegrationTest < ApplicationIntegrationTest
assert_response :ok
assert_equal "#{Mime[:csv]}; charset=utf-8", response.headers['Content-Type']
assert_equal 'attachment; filename="contacts.csv"', response.headers['Content-Disposition']
assert_equal "attachment; filename=\"contacts.csv\"; filename*=UTF-8''contacts.csv", response.headers['Content-Disposition']
assert_not_empty response.body
end
@ -19,7 +19,7 @@ class RegistrarAreaContactsIntegrationTest < ApplicationIntegrationTest
assert_response :ok
assert_equal Mime[:pdf], response.headers['Content-Type']
assert_equal 'attachment; filename="contacts.pdf"', response.headers['Content-Disposition']
assert_equal "attachment; filename=\"contacts.pdf\"; filename*=UTF-8''contacts.pdf", response.headers['Content-Disposition']
assert_not_empty response.body
end
end

View file

@ -13,7 +13,7 @@ class RegistrarAreaDomainsIntegrationTest < ApplicationIntegrationTest
assert_response :ok
assert_equal "#{Mime[:csv]}; charset=utf-8", response.headers['Content-Type']
assert_equal %(attachment; filename="Domains_#{l(now, format: :filename)}.csv"),
assert_equal %(attachment; filename="Domains_#{l(now, format: :filename)}.csv"; filename*=UTF-8''Domains_#{l(now, format: :filename)}.csv),
response.headers['Content-Disposition']
assert_not_empty response.body
end

View file

@ -13,7 +13,7 @@ class RegistrarAreaInvoicesIntegrationTest < ApplicationIntegrationTest
assert_response :ok
assert_equal 'application/pdf', response.headers['Content-Type']
assert_equal 'attachment; filename="invoice-1.pdf"', response.headers['Content-Disposition']
assert_equal "attachment; filename=\"invoice-1.pdf\"; filename*=UTF-8''invoice-1.pdf", response.headers['Content-Disposition']
assert_not_empty response.body
end
end
end

View file

@ -9,7 +9,7 @@ class PaperTrailLearningTest < ActiveSupport::TestCase
ActiveRecord::Base.connection.create_table :posts do |t|
t.string :title
# Otherwise `touch_with_version` fails silently
# Otherwise `touch` fails silently
t.datetime :updated_at
end
end
@ -55,11 +55,11 @@ class PaperTrailLearningTest < ActiveSupport::TestCase
assert_equal 'update', version.event
end
def test_touch_with_version
def test_touch
@record = Post.create!(title: 'any')
assert_difference -> { @record.versions.size } do
@record.paper_trail.touch_with_version
@record.touch
end
end
end

View file

@ -16,7 +16,7 @@ class DomainVersionTest < ActiveSupport::TestCase
def test_assigns_creator_to_paper_trail_whodunnit
duplicate_domain = prepare_duplicate_domain
PaperTrail.whodunnit = @user.id_role_username
PaperTrail.request.whodunnit = @user.id_role_username
assert_difference 'duplicate_domain.versions.count', 1 do
duplicate_domain.save!
end
@ -28,7 +28,7 @@ class DomainVersionTest < ActiveSupport::TestCase
end
def test_assigns_updator_to_paper_trail_whodunnit
PaperTrail.whodunnit = @user.id_role_username
PaperTrail.request.whodunnit = @user.id_role_username
assert_difference '@domain.versions.count', 1 do
@domain.apply_registry_lock

View file

@ -15,7 +15,7 @@ class RegistrarDomainsTest < ApplicationSystemTestCase
visit registrar_domains_url
click_button 'Download CSV'
assert_equal 'attachment; filename="Domains_2010-07-05_10.30.csv"', response_headers['Content-Disposition']
assert_equal "attachment; filename=\"Domains_2010-07-05_10.30.csv\"; filename*=UTF-8''Domains_2010-07-05_10.30.csv", response_headers['Content-Disposition']
assert_equal expected_csv, page.body
end
end

View file

@ -10,7 +10,7 @@ if ENV['COVERAGE']
end
ENV['RAILS_ENV'] ||= 'test'
require File.expand_path('../../config/environment', __FILE__)
require_relative '../config/environment'
require 'rails/test_help'
require 'minitest/mock'
require 'capybara/rails'
@ -42,6 +42,9 @@ CompanyRegister::Client = CompanyRegisterClientStub
EInvoice.provider = EInvoice::Providers::TestProvider.new
class ActiveSupport::TestCase
# Run tests in parallel with specified workers
parallelize(workers: :number_of_processors)
ActiveRecord::Migration.check_pending!
fixtures :all