Sha256: 726c972cc3eabedfdd25b266811bebb4ca8f6ab0ab2d0a89cdc3182d78277449

Contents?: true

Size: 499 Bytes

Versions: 4

Compression:

Stored size: 499 Bytes

Contents

require 'minitest_helper'

def it_does_not_leak_view_context
  2.times do
    it "has an independent view context" do
      refute_equal :leaked, StrongPresenter::ViewContext.current
      StrongPresenter::ViewContext.current = :leaked
    end
  end
end

describe "A presenter test" do
  it_does_not_leak_view_context
end

describe "A controller test" do
  tests Class.new(ActionController::Base)

  it_does_not_leak_view_context
end

describe "A mailer test" do
  it_does_not_leak_view_context
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
strong_presenter-0.2.2 spec/dummy/test/presenters/minitest/view_context_test.rb
strong_presenter-0.2.1 spec/dummy/test/presenters/minitest/view_context_test.rb
strong_presenter-0.2.0 spec/dummy/test/presenters/minitest/view_context_test.rb
strong_presenter-0.1.0 spec/dummy/test/presenters/minitest/view_context_test.rb