repo stringlengths 5 92 | file_url stringlengths 80 287 | file_path stringlengths 5 197 | content stringlengths 0 32.8k | language stringclasses 1
value | license stringclasses 7
values | commit_sha stringlengths 40 40 | retrieved_at stringdate 2026-01-04 15:37:27 2026-01-04 17:58:21 | truncated bool 2
classes |
|---|---|---|---|---|---|---|---|---|
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/actionpack/test/routing/helper_test.rb | actionpack/test/routing/helper_test.rb | # frozen_string_literal: true
require "abstract_unit"
module ActionDispatch
module Routing
class HelperTest < ActiveSupport::TestCase
class Duck
def to_param
nil
end
end
def test_exception
rs = ::ActionDispatch::Routing::RouteSet.new
rs.draw do
... | ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/actionpack/test/fixtures/load_me.rb | actionpack/test/fixtures/load_me.rb | # frozen_string_literal: true
class LoadMe
end
| ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/actionpack/test/fixtures/company.rb | actionpack/test/fixtures/company.rb | # frozen_string_literal: true
class Company < ActiveRecord::Base
has_one :mascot
self.sequence_name = :companies_nonstd_seq
validates_presence_of :name
def validate
errors.add("rating", "rating should not be 2") if rating == 2
end
end
| ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/actionpack/test/fixtures/helpers/just_me_helper.rb | actionpack/test/fixtures/helpers/just_me_helper.rb | # frozen_string_literal: true
module JustMeHelper
def me() "mine!" end
end
| ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/actionpack/test/fixtures/helpers/me_too_helper.rb | actionpack/test/fixtures/helpers/me_too_helper.rb | # frozen_string_literal: true
module MeTooHelper
def me() "me too!" end
end
| ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/actionpack/test/fixtures/helpers/abc_helper.rb | actionpack/test/fixtures/helpers/abc_helper.rb | # frozen_string_literal: true
module AbcHelper
def bare_a() end
end
| ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/actionpack/test/fixtures/helpers/fun/pdf_helper.rb | actionpack/test/fixtures/helpers/fun/pdf_helper.rb | # frozen_string_literal: true
module Fun
module PdfHelper
def foobar() "baz" end
end
end
| ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/actionpack/test/fixtures/helpers/fun/games_helper.rb | actionpack/test/fixtures/helpers/fun/games_helper.rb | # frozen_string_literal: true
module Fun
module GamesHelper
def stratego() "Iz guuut!" end
end
end
| ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/actionpack/test/fixtures/alternate_helpers/foo_helper.rb | actionpack/test/fixtures/alternate_helpers/foo_helper.rb | # frozen_string_literal: true
module FooHelper
redefine_method(:baz) { }
end
| ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/actionpack/test/fixtures/helpers2_pack/pack2_helper.rb | actionpack/test/fixtures/helpers2_pack/pack2_helper.rb | # frozen_string_literal: true
module Pack2Helper
def conflicting_helper
"pack2"
end
end
| ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/actionpack/test/fixtures/session_autoload_test/session_autoload_test/foo.rb | actionpack/test/fixtures/session_autoload_test/session_autoload_test/foo.rb | # frozen_string_literal: true
module SessionAutoloadTest
class Foo
def initialize(bar = "baz")
@bar = bar
end
def inspect
"#<#{self.class} bar:#{@bar.inspect}>"
end
end
end
| ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/actionpack/test/fixtures/helpers1_pack/pack1_helper.rb | actionpack/test/fixtures/helpers1_pack/pack1_helper.rb | # frozen_string_literal: true
module Pack1Helper
def conflicting_helper
"pack1"
end
end
| ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/actionpack/test/fixtures/helpers_typo/admin/users_helper.rb | actionpack/test/fixtures/helpers_typo/admin/users_helper.rb | # frozen_string_literal: true
module Admin
module UsersHelpeR
end
end
| ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/actionpack/test/journey/routes_test.rb | actionpack/test/journey/routes_test.rb | # frozen_string_literal: true
require "abstract_unit"
module ActionDispatch
module Journey
class TestRoutes < ActiveSupport::TestCase
attr_reader :routes, :mapper
def setup
@route_set = ActionDispatch::Routing::RouteSet.new
@routes = @route_set.router.routes
@router = @route... | ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/actionpack/test/journey/router_test.rb | actionpack/test/journey/router_test.rb | # frozen_string_literal: true
require "abstract_unit"
require "rack/utils"
module ActionDispatch
module Journey
class TestRouter < ActiveSupport::TestCase
attr_reader :mapper, :routes, :route_set, :router
def setup
@app = Routing::RouteSet::Dispatcher.new({})
@route_set = ActionDisp... | ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/actionpack/test/journey/route_test.rb | actionpack/test/journey/route_test.rb | # frozen_string_literal: true
require "abstract_unit"
require "support/path_helper"
module ActionDispatch
module Journey
class TestRoute < ActiveSupport::TestCase
include PathHelper
def test_initialize
app = Object.new
path = path_from_string "/:controller(/:action(/:id(.:f... | ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/actionpack/test/journey/gtg/transition_table_test.rb | actionpack/test/journey/gtg/transition_table_test.rb | # frozen_string_literal: true
require "abstract_unit"
require "active_support/json/decoding"
module ActionDispatch
module Journey
module GTG
class TestGeneralizedTable < ActiveSupport::TestCase
def test_to_json
table = tt %w{
/articles(.:format)
/articles/new(.:fo... | ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/actionpack/test/journey/gtg/builder_test.rb | actionpack/test/journey/gtg/builder_test.rb | # frozen_string_literal: true
require "abstract_unit"
module ActionDispatch
module Journey
module GTG
class TestBuilder < ActiveSupport::TestCase
def test_following_states_multi
table = tt ["a|a"]
assert_equal 1, table.move([0, nil], "a", "a", 0, true).each_slice(2).count
... | ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/actionpack/test/journey/nodes/symbol_test.rb | actionpack/test/journey/nodes/symbol_test.rb | ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false | |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/actionpack/test/journey/nodes/ast_test.rb | actionpack/test/journey/nodes/ast_test.rb | # frozen_string_literal: true
require "abstract_unit"
module ActionDispatch
module Journey
module Nodes
class TestAst < ActiveSupport::TestCase
def test_ast_sets_regular_expressions
requirements = { name: /(tender|love)/, value: /./ }
path = "/page/:name/:value"
tree ... | ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/actionpack/test/journey/route/definition/parser_test.rb | actionpack/test/journey/route/definition/parser_test.rb | # frozen_string_literal: true
require "abstract_unit"
module ActionDispatch
module Journey
module Definition
class TestParser < ActiveSupport::TestCase
def setup
@parser = Parser.new
end
def test_slash
assert_equal :SLASH, @parser.parse("/").type
asse... | ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/actionpack/test/journey/route/definition/scanner_test.rb | actionpack/test/journey/route/definition/scanner_test.rb | # frozen_string_literal: true
require "abstract_unit"
module ActionDispatch
module Journey
module Definition
class TestScanner < ActiveSupport::TestCase
def setup
@scanner = Scanner.new
end
CASES = [
["/", [:SLASH]],
["*omg", [:STAR]],
... | ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/actionpack/test/journey/router/utils_test.rb | actionpack/test/journey/router/utils_test.rb | # frozen_string_literal: true
require "abstract_unit"
module ActionDispatch
module Journey
class Router
class TestUtils < ActiveSupport::TestCase
def test_path_escape
assert_equal "a/b%20c+d%25", Utils.escape_path("a/b c+d%")
end
def test_segment_escape
assert_... | ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/actionpack/test/journey/path/pattern_test.rb | actionpack/test/journey/path/pattern_test.rb | # frozen_string_literal: true
require "abstract_unit"
require "support/path_helper"
module ActionDispatch
module Journey
module Path
class TestPattern < ActiveSupport::TestCase
include PathHelper
SEPARATORS = ["/", ".", "?"].join
x = /.+/
{
"/:controller(/:actio... | ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/actionpack/test/assertions/response_assertions_test.rb | actionpack/test/assertions/response_assertions_test.rb | # frozen_string_literal: true
require "abstract_unit"
require "action_dispatch/testing/assertions/response"
module ActionDispatch
module Assertions
class ResponseAssertionsTest < ActiveSupport::TestCase
include ResponseAssertions
FakeResponse = Struct.new(:response_code, :location, :body) do
... | ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/actionpack/test/dispatch/debug_locks_test.rb | actionpack/test/dispatch/debug_locks_test.rb | # frozen_string_literal: true
require "abstract_unit"
class DebugLocksTest < ActionDispatch::IntegrationTest
setup do
build_app
end
def test_render_threads_status
thread_ready = Concurrent::CountDownLatch.new
test_terminated = Concurrent::CountDownLatch.new
thread = Thread.new do
ActiveS... | ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/actionpack/test/dispatch/mapper_test.rb | actionpack/test/dispatch/mapper_test.rb | # frozen_string_literal: true
require "abstract_unit"
module ActionDispatch
module Routing
class MapperTest < ActiveSupport::TestCase
class FakeSet < ActionDispatch::Routing::RouteSet
def resources_path_names
{}
end
def request_class
ActionDispatch::Request
... | ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/actionpack/test/dispatch/content_disposition_test.rb | actionpack/test/dispatch/content_disposition_test.rb | # frozen_string_literal: true
require "abstract_unit"
module ActionDispatch
class ContentDispositionTest < ActiveSupport::TestCase
test "encoding a Latin filename" do
disposition = Http::ContentDisposition.new(disposition: :inline, filename: "racecar.jpg")
assert_equal %(filename="racecar.jpg"), di... | ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/actionpack/test/dispatch/middleware_stack_test.rb | actionpack/test/dispatch/middleware_stack_test.rb | # frozen_string_literal: true
require "abstract_unit"
class MiddlewareStackTest < ActiveSupport::TestCase
class Base
def initialize(app)
@app = app
end
def call(env)
@app.call(env)
end
end
class FooMiddleware < Base; end
class BarMiddleware < Base; end
class BazMiddleware < Bas... | ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/actionpack/test/dispatch/structured_event_subscriber_test.rb | actionpack/test/dispatch/structured_event_subscriber_test.rb | # frozen_string_literal: true
require "abstract_unit"
require "active_support/testing/event_reporter_assertions"
require "action_dispatch/structured_event_subscriber"
module ActionDispatch
class StructuredEventSubscriberTest < ActionDispatch::IntegrationTest
include ActiveSupport::Testing::EventReporterAssertio... | ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/actionpack/test/dispatch/request_id_test.rb | actionpack/test/dispatch/request_id_test.rb | # frozen_string_literal: true
require "abstract_unit"
class RequestIdTest < ActiveSupport::TestCase
test "passing on the request id from the outside" do
assert_equal "external-uu-rid", stub_request({ "HTTP_X_REQUEST_ID" => "external-uu-rid" }).request_id
end
test "passing on the request id via a configured... | ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/actionpack/test/dispatch/cookies_test.rb | actionpack/test/dispatch/cookies_test.rb | # frozen_string_literal: true
require "abstract_unit"
require "openssl"
require "active_support/key_generator"
require "active_support/messages/rotation_configuration"
class CookieJarTest < ActiveSupport::TestCase
attr_reader :request
def setup
@request = ActionDispatch::Request.empty
end
def test_fetch... | ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | true |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/actionpack/test/dispatch/live_response_test.rb | actionpack/test/dispatch/live_response_test.rb | # frozen_string_literal: true
require "abstract_unit"
require "concurrent/atomic/count_down_latch"
module ActionController
module Live
class ResponseTest < ActiveSupport::TestCase
def setup
@response = Live::Response.new
@response.request = ActionDispatch::Request.empty
end
de... | ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/actionpack/test/dispatch/uploaded_file_test.rb | actionpack/test/dispatch/uploaded_file_test.rb | # frozen_string_literal: true
require "abstract_unit"
require "tempfile"
require "stringio"
module ActionDispatch
class UploadedFileTest < ActiveSupport::TestCase
def test_constructor_with_argument_error
assert_raises(ArgumentError) do
Http::UploadedFile.new({})
end
end
def test_ori... | ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/actionpack/test/dispatch/routing_assertions_test.rb | actionpack/test/dispatch/routing_assertions_test.rb | # frozen_string_literal: true
require "abstract_unit"
require "rails/engine"
require "controller/fake_controllers"
class SecureArticlesController < ArticlesController
def index
render(inline: "")
end
end
class BlockArticlesController < ArticlesController; end
class QueryArticlesController < ArticlesController... | ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/actionpack/test/dispatch/ssl_test.rb | actionpack/test/dispatch/ssl_test.rb | # frozen_string_literal: true
require "abstract_unit"
class SSLTest < ActionDispatch::IntegrationTest
attr_accessor :app
def build_app(headers: {}, ssl_options: {})
app = lambda { |env| [200, headers, []] }
Rack::Lint.new(
ActionDispatch::SSL.new(
Rack::Lint.new(app),
hsts: { subdom... | ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/actionpack/test/dispatch/param_builder_test.rb | actionpack/test/dispatch/param_builder_test.rb | # frozen_string_literal: true
require "abstract_unit"
class ParamBuilderTest < ActiveSupport::TestCase
# Much of the behavioral details are covered by long-standing
# integration tests in test/request/query_string_parsing_test.rb
#
# This test doesn't need to duplicate all of that: it just
# offers a simple... | ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/actionpack/test/dispatch/actionable_exceptions_test.rb | actionpack/test/dispatch/actionable_exceptions_test.rb | # frozen_string_literal: true
require "abstract_unit"
class ActionableExceptionsTest < ActionDispatch::IntegrationTest
Actions = []
class ActionError < StandardError
include ActiveSupport::ActionableError
action "Successful action" do
Actions << "Action!"
end
action "Failed action" do
... | ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/actionpack/test/dispatch/query_parser_test.rb | actionpack/test/dispatch/query_parser_test.rb | # frozen_string_literal: true
require "abstract_unit"
class QueryParserTest < ActiveSupport::TestCase
test "simple query string" do
assert_equal [["foo", "bar"], ["baz", "quux"]], parsed_pairs("foo=bar&baz=quux")
end
test "query string with empty and missing values" do
assert_equal [["foo", "bar"], ["e... | ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/actionpack/test/dispatch/test_request_test.rb | actionpack/test/dispatch/test_request_test.rb | # frozen_string_literal: true
require "abstract_unit"
class TestRequestTest < ActiveSupport::TestCase
test "reasonable defaults" do
env = ActionDispatch::TestRequest.create.env
assert_equal "GET", env.delete("REQUEST_METHOD")
assert_equal "off", env.delete("HTTPS")
assert_equal "http", env.delete("... | ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/actionpack/test/dispatch/routing_test.rb | actionpack/test/dispatch/routing_test.rb | # frozen_string_literal: true
require "erb"
require "abstract_unit"
require "controller/fake_controllers"
require "active_support/messages/rotation_configuration"
class TestRoutingMapper < ActionDispatch::IntegrationTest
SprocketsApp = lambda { |env|
[200, { "Content-Type" => "text/html" }, ["javascripts"]]
}... | ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | true |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/actionpack/test/dispatch/static_test.rb | actionpack/test/dispatch/static_test.rb | # frozen_string_literal: true
require "abstract_unit"
require "zlib"
class StaticTest < ActiveSupport::TestCase
DummyApp = lambda { |env|
[200, { Rack::CONTENT_TYPE => "text/plain" }, ["Hello, World!"]]
}
def public_path
"public"
end
def setup
silence_warnings do
@default_internal_encodi... | ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/actionpack/test/dispatch/response_test.rb | actionpack/test/dispatch/response_test.rb | # frozen_string_literal: true
require "abstract_unit"
require "timeout"
require "rack/content_length"
class ResponseTest < ActiveSupport::TestCase
def setup
@response = ActionDispatch::Response.create
@response.request = ActionDispatch::Request.empty
end
def test_can_wait_until_commit
t = Thread.ne... | ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/actionpack/test/dispatch/exception_wrapper_test.rb | actionpack/test/dispatch/exception_wrapper_test.rb | # frozen_string_literal: true
require "abstract_unit"
module ActionDispatch
class ExceptionWrapperTest < ActionDispatch::IntegrationTest
class TestError < StandardError
end
class TopErrorProxy < StandardError
def initialize(ex, n)
@ex = ex
@n = n
end
def backtrace
... | ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/actionpack/test/dispatch/request_test.rb | actionpack/test/dispatch/request_test.rb | # frozen_string_literal: true
require "abstract_unit"
class BaseRequestTest < ActiveSupport::TestCase
def setup
@original_tld_length = ActionDispatch::Http::URL.tld_length
end
def teardown
ActionDispatch::Http::URL.tld_length = @original_tld_length
end
def url_for(options = {})
options = { hos... | ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | true |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/actionpack/test/dispatch/show_exceptions_test.rb | actionpack/test/dispatch/show_exceptions_test.rb | # frozen_string_literal: true
require "abstract_unit"
class ShowExceptionsTest < ActionDispatch::IntegrationTest
class Boomer
def call(env)
req = ActionDispatch::Request.new(env)
case req.path
when "/not_found"
raise AbstractController::ActionNotFound
when "/invalid_mimetype"
... | ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/actionpack/test/dispatch/header_test.rb | actionpack/test/dispatch/header_test.rb | # frozen_string_literal: true
require "abstract_unit"
class HeaderTest < ActiveSupport::TestCase
def make_headers(hash)
ActionDispatch::Http::Headers.new ActionDispatch::Request.new hash
end
setup do
@headers = make_headers(
"CONTENT_TYPE" => "text/plain",
"HTTP_REFERER" => "/some/page"
... | ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/actionpack/test/dispatch/mount_test.rb | actionpack/test/dispatch/mount_test.rb | # frozen_string_literal: true
require "abstract_unit"
require "rails/engine"
class TestRoutingMount < ActionDispatch::IntegrationTest
Router = ActionDispatch::Routing::RouteSet.new
class AppWithRoutes < Rails::Engine
def self.routes
@routes ||= ActionDispatch::Routing::RouteSet.new
end
end
# T... | ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/actionpack/test/dispatch/content_security_policy_test.rb | actionpack/test/dispatch/content_security_policy_test.rb | # frozen_string_literal: true
require "abstract_unit"
class ContentSecurityPolicyTest < ActiveSupport::TestCase
def setup
@policy = ActionDispatch::ContentSecurityPolicy.new
end
def test_build
assert_equal "", @policy.build
@policy.script_src :self
assert_equal "script-src 'self'", @policy.bui... | ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/actionpack/test/dispatch/debug_exceptions_test.rb | actionpack/test/dispatch/debug_exceptions_test.rb | # frozen_string_literal: true
require "abstract_unit"
class DebugExceptionsTest < ActionDispatch::IntegrationTest
InterceptedErrorInstance = StandardError.new
class CustomActionableError < StandardError
include ActiveSupport::ActionableError
action "Action 1" do
nil
end
action "Action 2" ... | ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | true |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/actionpack/test/dispatch/reloader_test.rb | actionpack/test/dispatch/reloader_test.rb | # frozen_string_literal: true
require "abstract_unit"
class ReloaderTest < ActiveSupport::TestCase
teardown do
ActiveSupport::Reloader.reset_callbacks :prepare
ActiveSupport::Reloader.reset_callbacks :complete
end
class MyBody < Array
def initialize(&block)
@on_close = block
end
def ... | ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/actionpack/test/dispatch/server_timing_test.rb | actionpack/test/dispatch/server_timing_test.rb | # frozen_string_literal: true
require "abstract_unit"
class ServerTimingTest < ActionDispatch::IntegrationTest
class TestController < ActionController::Base
def index
head :ok
end
def show
ActiveSupport::Notifications.instrument("custom.event") do
true
end
head :ok
e... | ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/actionpack/test/dispatch/prefix_generation_test.rb | actionpack/test/dispatch/prefix_generation_test.rb | # frozen_string_literal: true
require "abstract_unit"
require "rack/test"
require "rails/engine"
module TestGenerationPrefix
class Post
extend ActiveModel::Naming
def to_param
"1"
end
def self.model_name
klass = +"Post"
def klass.name; self end
ActiveModel::Name.new(klass)... | ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/actionpack/test/dispatch/rack_cache_test.rb | actionpack/test/dispatch/rack_cache_test.rb | # frozen_string_literal: true
require "abstract_unit"
require "action_dispatch/http/rack_cache"
class RackCacheMetaStoreTest < ActiveSupport::TestCase
class ReadWriteHash < ::Hash
alias :read :[]
alias :write :[]=
end
setup do
@store = ActionDispatch::RailsMetaStore.new(ReadWriteHash.new)
end
... | ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/actionpack/test/dispatch/executor_test.rb | actionpack/test/dispatch/executor_test.rb | # frozen_string_literal: true
require "abstract_unit"
require "active_support/core_ext/object/with"
class ExecutorTest < ActiveSupport::TestCase
class MyBody < Array
def initialize(&block)
@on_close = block
end
def foo
"foo"
end
def bar
"bar"
end
def close
@on_... | ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/actionpack/test/dispatch/host_authorization_test.rb | actionpack/test/dispatch/host_authorization_test.rb | # frozen_string_literal: true
require "abstract_unit"
require "ipaddr"
class HostAuthorizationTest < ActionDispatch::IntegrationTest
App = -> env { [200, {}, %w(Success)] }
test "blocks requests to unallowed host with empty body" do
@app = build_app(%w(only.com))
get "/"
assert_response :forbidden
... | ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/actionpack/test/dispatch/test_response_test.rb | actionpack/test/dispatch/test_response_test.rb | # frozen_string_literal: true
require "abstract_unit"
class TestResponseTest < ActiveSupport::TestCase
def assert_response_code_range(range, predicate)
response = ActionDispatch::TestResponse.new
(0..599).each do |status|
response.status = status
assert_equal range.include?(status), response.sen... | ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/actionpack/test/dispatch/runner_test.rb | actionpack/test/dispatch/runner_test.rb | # frozen_string_literal: true
require "abstract_unit"
class RunnerTest < ActiveSupport::TestCase
test "runner preserves the setting of integration_session" do
runner = Class.new do
def before_setup
end
end.new
runner.extend(ActionDispatch::Integration::Runner)
runner.integration_session... | ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/actionpack/test/dispatch/mime_type_test.rb | actionpack/test/dispatch/mime_type_test.rb | # frozen_string_literal: true
require "abstract_unit"
class MimeTypeTest < ActiveSupport::TestCase
test "parse single" do
Mime::LOOKUP.each_key do |mime_type|
unless mime_type == "image/*"
assert_equal [Mime::Type.lookup(mime_type)], Mime::Type.parse(mime_type)
end
end
end
test "unr... | ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/actionpack/test/dispatch/permissions_policy_test.rb | actionpack/test/dispatch/permissions_policy_test.rb | # frozen_string_literal: true
require "abstract_unit"
class PermissionsPolicyTest < ActiveSupport::TestCase
def setup
@policy = ActionDispatch::PermissionsPolicy.new
end
def test_mappings
@policy.midi :self
assert_equal "midi 'self'", @policy.build
@policy.midi :none
assert_equal "midi 'no... | ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/actionpack/test/dispatch/url_generation_test.rb | actionpack/test/dispatch/url_generation_test.rb | # frozen_string_literal: true
require "abstract_unit"
module TestUrlGeneration
class WithMountPoint < ActionDispatch::IntegrationTest
Routes = ActionDispatch::Routing::RouteSet.new
include Routes.url_helpers
class ::MyRouteGeneratingController < ActionController::Base
include Routes.url_helpers
... | ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/actionpack/test/dispatch/callbacks_test.rb | actionpack/test/dispatch/callbacks_test.rb | # frozen_string_literal: true
require "abstract_unit"
class DispatcherTest < ActiveSupport::TestCase
class Foo
cattr_accessor :a, :b
end
class DummyApp
def call(env)
[200, {}, "response"]
end
end
def setup
Foo.a, Foo.b = 0, 0
ActionDispatch::Callbacks.reset_callbacks(:call)
end... | ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/actionpack/test/dispatch/assume_ssl_test.rb | actionpack/test/dispatch/assume_ssl_test.rb | # frozen_string_literal: true
require "abstract_unit"
class AssumeSSLTest < ActiveSupport::TestCase
test "sets expected headers" do
app = lambda { |_env| [ 200, {}, [] ] }
env = Rack::MockRequest.env_for("", {})
Rack::Lint.new(
ActionDispatch::AssumeSSL.new(
Rack::Lint.new(app)
)
... | ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/actionpack/test/dispatch/routing/instrumentation_test.rb | actionpack/test/dispatch/routing/instrumentation_test.rb | # frozen_string_literal: true
require "abstract_unit"
class RoutingInstrumentationTest < ActionDispatch::IntegrationTest
test "redirect is instrumented" do
draw do
get "redirect", to: redirect("/login")
end
notification = assert_notification("redirect.action_dispatch", status: 301, location: "htt... | ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/actionpack/test/dispatch/routing/non_dispatch_routed_app_test.rb | actionpack/test/dispatch/routing/non_dispatch_routed_app_test.rb | # frozen_string_literal: true
require "abstract_unit"
module ActionDispatch
module Routing
class NonDispatchRoutedAppTest < ActionDispatch::IntegrationTest
# For example, Grape::API
class SimpleApp
def self.call(env)
[ 200, { "Content-Type" => "text/plain" }, [] ]
end
... | ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/actionpack/test/dispatch/routing/log_subscriber_test.rb | actionpack/test/dispatch/routing/log_subscriber_test.rb | # frozen_string_literal: true
require "abstract_unit"
require "active_support/log_subscriber/test_helper"
require "action_dispatch/structured_event_subscriber"
require "action_dispatch/log_subscriber"
class RoutingLogSubscriberTest < ActionDispatch::IntegrationTest
setup do
@logger = ActiveSupport::LogSubscribe... | ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/actionpack/test/dispatch/routing/inspector_test.rb | actionpack/test/dispatch/routing/inspector_test.rb | # frozen_string_literal: true
require "abstract_unit"
require "rails/engine"
require "action_dispatch/routing/inspector"
require "io/console/size"
class MountedRackApp
def self.call(env)
end
end
class Rails::DummyController
end
module InspectorTestApp
class PostsController < ActionController::Base
def ind... | ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/actionpack/test/dispatch/routing/route_set_test.rb | actionpack/test/dispatch/routing/route_set_test.rb | # frozen_string_literal: true
require "abstract_unit"
module ActionDispatch
module Routing
class RouteSetTest < ActiveSupport::TestCase
class SimpleApp
def initialize(response)
@response = response
end
def call(env)
[ 200, { "Content-Type" => "text/plain" }, [r... | ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/actionpack/test/dispatch/routing/concerns_test.rb | actionpack/test/dispatch/routing/concerns_test.rb | # frozen_string_literal: true
require "abstract_unit"
class ReviewsController < ResourcesController; end
class RoutingConcernsTest < ActionDispatch::IntegrationTest
class Reviewable
def self.call(mapper, options = {})
mapper.resources :reviews, **options
end
end
Routes = ActionDispatch::Routing:... | ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/actionpack/test/dispatch/routing/custom_url_helpers_test.rb | actionpack/test/dispatch/routing/custom_url_helpers_test.rb | # frozen_string_literal: true
require "abstract_unit"
class TestCustomUrlHelpers < ActionDispatch::IntegrationTest
class Linkable
attr_reader :id
def self.name
super.demodulize
end
def initialize(id)
@id = id
end
def linkable_type
self.class.name.underscore
end
end... | ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/actionpack/test/dispatch/routing/ipv6_redirect_test.rb | actionpack/test/dispatch/routing/ipv6_redirect_test.rb | # frozen_string_literal: true
require "abstract_unit"
class IPv6IntegrationTest < ActionDispatch::IntegrationTest
Routes = ActionDispatch::Routing::RouteSet.new
include Routes.url_helpers
class ::BadRouteRequestController < ActionController::Base
include Routes.url_helpers
def index
render plain:... | ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/actionpack/test/dispatch/system_testing/system_test_case_test.rb | actionpack/test/dispatch/system_testing/system_test_case_test.rb | # frozen_string_literal: true
require "abstract_unit"
require "support/system_helper"
require "selenium/webdriver"
class SetDriverToRackTestTest < DrivenByRackTest
test "uses rack_test" do
assert_equal :rack_test, Capybara.current_driver
end
end
class OverrideSeleniumSubclassToRackTestTest < DrivenBySelenium... | ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/actionpack/test/dispatch/system_testing/screenshot_helper_test.rb | actionpack/test/dispatch/system_testing/screenshot_helper_test.rb | # frozen_string_literal: true
require "abstract_unit"
require "support/system_helper"
require "action_dispatch/system_testing/test_helpers/screenshot_helper"
require "capybara/dsl"
require "selenium/webdriver"
class ScreenshotHelperTest < ActiveSupport::TestCase
def setup
@new_test = DrivenBySeleniumWithChrome.... | ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/actionpack/test/dispatch/system_testing/server_test.rb | actionpack/test/dispatch/system_testing/server_test.rb | # frozen_string_literal: true
require "abstract_unit"
require "capybara/dsl"
require "action_dispatch/system_testing/server"
class ServerTest < ActiveSupport::TestCase
setup do
@old_capybara_server = Capybara.server
end
test "port is always included" do
ActionDispatch::SystemTesting::Server.new.run
... | ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/actionpack/test/dispatch/system_testing/driver_test.rb | actionpack/test/dispatch/system_testing/driver_test.rb | # frozen_string_literal: true
require "abstract_unit"
require "support/system_helper"
require "action_dispatch/system_testing/driver"
require "selenium/webdriver"
class DriverTest < ActiveSupport::TestCase
test "initializing the driver" do
driver = ActionDispatch::SystemTesting::Driver.new(:selenium)
assert... | ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/actionpack/test/dispatch/session/abstract_secure_store_test.rb | actionpack/test/dispatch/session/abstract_secure_store_test.rb | # frozen_string_literal: true
require "abstract_unit"
require "action_dispatch/middleware/session/abstract_store"
module ActionDispatch
module Session
class AbstractSecureStoreTest < ActiveSupport::TestCase
class MemoryStore < AbstractSecureStore
class SessionId < Rack::Session::SessionId
... | ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/actionpack/test/dispatch/session/cache_store_test.rb | actionpack/test/dispatch/session/cache_store_test.rb | # frozen_string_literal: true
require "abstract_unit"
class CacheStoreTest < ActionDispatch::IntegrationTest
class TestController < ActionController::Base
def no_session_access
head :ok
end
def set_session_value
session[:foo] = "bar"
head :ok
end
def set_serialized_session_va... | ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/actionpack/test/dispatch/session/mem_cache_store_test.rb | actionpack/test/dispatch/session/mem_cache_store_test.rb | # frozen_string_literal: true
require "abstract_unit"
require "securerandom"
# You need to start a memcached server inorder to run these tests
class MemCacheStoreTest < ActionDispatch::IntegrationTest
class TestController < ActionController::Base
def no_session_access
head :ok
end
def set_session... | ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/actionpack/test/dispatch/session/test_session_test.rb | actionpack/test/dispatch/session/test_session_test.rb | # frozen_string_literal: true
require "abstract_unit"
require "stringio"
class ActionController::TestSessionTest < ActiveSupport::TestCase
def test_initialize_with_values
session = ActionController::TestSession.new(one: "one", two: "two")
assert_equal("one", session[:one])
assert_equal("two", session[:t... | ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/actionpack/test/dispatch/session/cookie_store_test.rb | actionpack/test/dispatch/session/cookie_store_test.rb | # frozen_string_literal: true
require "abstract_unit"
require "stringio"
require "active_support/key_generator"
require "active_support/messages/rotation_configuration"
class CookieStoreTest < ActionDispatch::IntegrationTest
SessionKey = "_myapp_session"
SessionSecret = "b3c631c314c0bbca50c1b2843150fe33"
Sessio... | ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/actionpack/test/dispatch/session/abstract_store_test.rb | actionpack/test/dispatch/session/abstract_store_test.rb | # frozen_string_literal: true
require "abstract_unit"
require "action_dispatch/middleware/session/abstract_store"
module ActionDispatch
module Session
class AbstractStoreTest < ActiveSupport::TestCase
class MemoryStore < AbstractStore
def initialize(app)
@sessions = {}
super
... | ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/actionpack/test/dispatch/request/session_test.rb | actionpack/test/dispatch/request/session_test.rb | # frozen_string_literal: true
require "abstract_unit"
require "action_dispatch/middleware/session/abstract_store"
module ActionDispatch
class Request
class SessionTest < ActiveSupport::TestCase
attr_reader :req
def setup
@req = ActionDispatch::Request.empty
end
def test_create_... | ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/actionpack/test/dispatch/request/multipart_params_parsing_test.rb | actionpack/test/dispatch/request/multipart_params_parsing_test.rb | # frozen_string_literal: true
require "abstract_unit"
class MultipartParamsParsingTest < ActionDispatch::IntegrationTest
class TestController < ActionController::Base
skip_parameter_encoding("parse_binary")
class << self
attr_accessor :last_request_parameters, :last_parameters
end
def parse_... | ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/actionpack/test/dispatch/request/query_string_parsing_test.rb | actionpack/test/dispatch/request/query_string_parsing_test.rb | # frozen_string_literal: true
require "abstract_unit"
class QueryStringParsingTest < ActionDispatch::IntegrationTest
class TestController < ActionController::Base
class << self
attr_accessor :last_query_parameters
end
def parse
self.class.last_query_parameters = request.query_parameters
... | ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/actionpack/test/dispatch/request/json_params_parsing_test.rb | actionpack/test/dispatch/request/json_params_parsing_test.rb | # frozen_string_literal: true
require "abstract_unit"
class JsonParamsParsingTest < ActionDispatch::IntegrationTest
class TestController < ActionController::Base
class << self
attr_accessor :last_request_parameters
end
def parse
self.class.last_request_parameters = request.request_parameter... | ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/actionpack/test/dispatch/request/url_encoded_params_parsing_test.rb | actionpack/test/dispatch/request/url_encoded_params_parsing_test.rb | # frozen_string_literal: true
require "abstract_unit"
class UrlEncodedParamsParsingTest < ActionDispatch::IntegrationTest
class TestController < ActionController::Base
class << self
attr_accessor :last_request_parameters, :last_request_type
end
def parse
self.class.last_request_parameters =... | ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/actionpack/test/lib/test_renderable.rb | actionpack/test/lib/test_renderable.rb | # frozen_string_literal: true
class TestRenderable
def render_in(_view_context)
"Hello, World!"
end
def format
:html
end
end
| ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/actionpack/test/lib/controller/fake_controllers.rb | actionpack/test/lib/controller/fake_controllers.rb | # frozen_string_literal: true
class ContentController < ActionController::Base; end
module Admin
class AccountsController < ActionController::Base; end
class PostsController < ActionController::Base; end
class StuffController < ActionController::Base; end
class UserController < ActionController::Base; end
c... | ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/actionpack/test/lib/controller/fake_models.rb | actionpack/test/lib/controller/fake_models.rb | # frozen_string_literal: true
require "active_model"
Customer = Struct.new(:name, :id) do
extend ActiveModel::Naming
include ActiveModel::Conversion
undef_method :to_json
def to_xml(options = {})
if options[:builder]
options[:builder].name name
else
"<name>#{name}</name>"
end
end
... | ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/actionpack/lib/abstract_controller.rb | actionpack/lib/abstract_controller.rb | # frozen_string_literal: true
# :markup: markdown
require "action_pack"
require "active_support"
require "active_support/rails"
require "active_support/i18n"
require "abstract_controller/deprecator"
module AbstractController
extend ActiveSupport::Autoload
autoload :ActionNotFound, "abstract_controller/base"
a... | ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/actionpack/lib/action_pack.rb | actionpack/lib/action_pack.rb | # frozen_string_literal: true
#--
# Copyright (c) David Heinemeier Hansson
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to... | ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/actionpack/lib/action_controller.rb | actionpack/lib/action_controller.rb | # frozen_string_literal: true
# :markup: markdown
require "abstract_controller"
require "action_dispatch"
require "action_controller/deprecator"
require "action_controller/metal/strong_parameters"
require "action_controller/metal/exceptions"
# # Action Controller
#
# Action Controller is a module of Action Pack.
#
#... | ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/actionpack/lib/action_dispatch.rb | actionpack/lib/action_dispatch.rb | # frozen_string_literal: true
#--
# Copyright (c) David Heinemeier Hansson
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to... | ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/actionpack/lib/action_pack/version.rb | actionpack/lib/action_pack/version.rb | # frozen_string_literal: true
# :markup: markdown
require_relative "gem_version"
module ActionPack
# Returns the currently loaded version of Action Pack as a `Gem::Version`.
def self.version
gem_version
end
end
| ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/actionpack/lib/action_pack/gem_version.rb | actionpack/lib/action_pack/gem_version.rb | # frozen_string_literal: true
# :markup: markdown
module ActionPack
# Returns the currently loaded version of Action Pack as a `Gem::Version`.
def self.gem_version
Gem::Version.new VERSION::STRING
end
module VERSION
MAJOR = 8
MINOR = 2
TINY = 0
PRE = "alpha"
STRING = [MAJOR, MINOR... | ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/actionpack/lib/abstract_controller/logger.rb | actionpack/lib/abstract_controller/logger.rb | # frozen_string_literal: true
# :markup: markdown
require "active_support/benchmarkable"
module AbstractController
module Logger # :nodoc:
extend ActiveSupport::Concern
included do
singleton_class.delegate :logger, :logger=, to: :config
delegate :logger, :logger=, to: :config
include Act... | ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/actionpack/lib/abstract_controller/collector.rb | actionpack/lib/abstract_controller/collector.rb | # frozen_string_literal: true
# :markup: markdown
require "action_dispatch/http/mime_type"
module AbstractController
module Collector
def self.generate_method_for_mime(mime)
sym = mime.is_a?(Symbol) ? mime : mime.to_sym
class_eval <<-RUBY, __FILE__, __LINE__ + 1
def #{sym}(...)
cu... | ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/actionpack/lib/abstract_controller/translation.rb | actionpack/lib/abstract_controller/translation.rb | # frozen_string_literal: true
# :markup: markdown
require "active_support/html_safe_translation"
module AbstractController
module Translation
# Delegates to `I18n.translate`.
#
# When the given key starts with a period, it will be scoped by the current
# controller and action. So if you call `trans... | ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/actionpack/lib/abstract_controller/url_for.rb | actionpack/lib/abstract_controller/url_for.rb | # frozen_string_literal: true
# :markup: markdown
module AbstractController
# # URL For
#
# Includes `url_for` into the host class (e.g. an abstract controller or
# mailer). The class has to provide a `RouteSet` by implementing the `_routes`
# methods. Otherwise, an exception will be raised.
#
# Note th... | ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
rails/rails | https://github.com/rails/rails/blob/ba0d6f09e991d0621cc30f19c9d189cd21dbf76e/actionpack/lib/abstract_controller/asset_paths.rb | actionpack/lib/abstract_controller/asset_paths.rb | # frozen_string_literal: true
# :markup: markdown
module AbstractController
module AssetPaths # :nodoc:
extend ActiveSupport::Concern
included do
singleton_class.delegate :asset_host, :asset_host=, :assets_dir, :assets_dir=, :javascripts_dir, :javascripts_dir=,
:stylesheets_dir, :stylesheets_... | ruby | MIT | ba0d6f09e991d0621cc30f19c9d189cd21dbf76e | 2026-01-04T15:37:27.222351Z | false |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.