Merge pull request #44529 from Shopify/actionview-fix-flaky-tests

Fix flaky Action View tests
This commit is contained in:
Rafael Mendonça França 2022-02-25 14:47:49 -05:00 committed by GitHub
commit b64cbc0b27
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 9 additions and 0 deletions

View File

@ -30,6 +30,8 @@ class ViewLoadPathsTest < ActionController::TestCase
end
def setup
ActionView::LookupContext::DetailsKey.clear
@controller = TestController.new
@request = ActionController::TestRequest.create(@controller.class)
@response = ActionDispatch::TestResponse.new

View File

@ -52,6 +52,11 @@ class RenderPartialWithRecordIdentificationTest < ActiveRecordTestCase
tests RenderPartialWithRecordIdentificationController
fixtures :developers, :projects, :developers_projects, :topics, :replies, :companies, :mascots
def setup
super
ActionView::LookupContext::DetailsKey.clear
end
def test_rendering_partial_with_has_many_and_belongs_to_association
get :render_with_has_many_and_belongs_to_association
assert_equal Developer.find(1).projects.map(&:name).join, @response.body

View File

@ -712,6 +712,8 @@ class FrozenStringLiteralEnabledViewRenderTest < ActiveSupport::TestCase
include RenderTestCases
def setup
ActionView::LookupContext::DetailsKey.clear
@previous_frozen_literal = ActionView::Template.frozen_string_literal
ActionView::Template.frozen_string_literal = true
view_paths = ActionController::Base.view_paths