Sha256: 15133dc7c786bf063caa498d606136065983b105b18c3adfabbdd99254e4cfe1

Contents?: true

Size: 995 Bytes

Versions: 6

Compression:

Stored size: 995 Bytes

Contents

module Minitest
  module Utils
    module Locale
      class << self
        attr_accessor :setup
        attr_accessor :teardown
      end

      self.setup = proc do
        Rails.application.routes.default_url_options[:locale] = I18n.locale
      end

      self.teardown = proc do
        Rails.application.routes.default_url_options.delete(:locale)
      end

      def self.included(base)
        base.setup do
          instance_eval(&Minitest::Utils::Locale.setup)
        end

        base.teardown do
          instance_eval(&Minitest::Utils::Locale.teardown)
        end
      end
    end
  end
end

module ActionDispatch
  class IntegrationTest
    include Minitest::Utils::UrlHelpers
    include Minitest::Utils::Locale
  end
end

module ActionController
  class TestCase
    include Minitest::Utils::UrlHelpers
    include Minitest::Utils::Locale
  end
end

module ActionMailer
  class TestCase
    include Minitest::Utils::UrlHelpers
    include Minitest::Utils::Locale
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
minitest-utils-0.4.4 lib/minitest/utils/rails/locale.rb
minitest-utils-0.4.3 lib/minitest/utils/rails/locale.rb
minitest-utils-0.4.2 lib/minitest/utils/rails/locale.rb
minitest-utils-0.4.1 lib/minitest/utils/rails/locale.rb
minitest-utils-0.4.0 lib/minitest/utils/rails/locale.rb
minitest-utils-0.3.1 lib/minitest/utils/rails/locale.rb