class TestPartialDynamicPathSegments

Constants

APP
Routes

Public Instance Methods

app() click to toggle source
# File actionpack/test/dispatch/routing_test.rb, line 4831
def app
  APP
end
test_paths_with_partial_dynamic_segments_are_recognised() click to toggle source
# File actionpack/test/dispatch/routing_test.rb, line 4835
def test_paths_with_partial_dynamic_segments_are_recognised
  get "/david-bowie/changes-song"
  assert_equal 200, response.status
  assert_params artist: "david-bowie", song: "changes"

  get "/david-bowie/song-changes"
  assert_equal 200, response.status
  assert_params artist: "david-bowie", song: "changes"

  get "/songs/song-changes"
  assert_equal 200, response.status
  assert_params song: "changes"

  get "/songs/changes-song"
  assert_equal 200, response.status
  assert_params song: "changes"

  get "/optional/songs/song-changes"
  assert_equal 200, response.status
  assert_params song: "changes"

  get "/optional/songs/changes-song"
  assert_equal 200, response.status
  assert_params song: "changes"

  get "/optional/david-bowie/changes-song"
  assert_equal 200, response.status
  assert_params artist: "david-bowie", song: "changes"

  get "/optional/david-bowie/song-changes"
  assert_equal 200, response.status
  assert_params artist: "david-bowie", song: "changes"
end

Private Instance Methods

assert_params(params) click to toggle source
# File actionpack/test/dispatch/routing_test.rb, line 4871
def assert_params(params)
  assert_equal(params, request.path_parameters)
end