Home / Function/ Test_Redirect_Route_WithOptionalParamsWithoutValue() — fiber Function Reference

Test_Redirect_Route_WithOptionalParamsWithoutValue() — fiber Function Reference

Architecture documentation for the Test_Redirect_Route_WithOptionalParamsWithoutValue() function in redirect_test.go from the fiber codebase.

Entity Profile

Dependency Diagram

graph TD
  533ae92f_66af_93b8_c4aa_27f54319bfae["Test_Redirect_Route_WithOptionalParamsWithoutValue()"]
  fee77792_8d65_0d02_107f_9a956c66b44c["redirect_test.go"]
  533ae92f_66af_93b8_c4aa_27f54319bfae -->|defined in| fee77792_8d65_0d02_107f_9a956c66b44c
  style 533ae92f_66af_93b8_c4aa_27f54319bfae fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

redirect_test.go lines 138–150

func Test_Redirect_Route_WithOptionalParamsWithoutValue(t *testing.T) {
	t.Parallel()
	app := New()
	app.Get("/user/:name?", func(c Ctx) error {
		return c.JSON(c.Params("name"))
	}).Name("user")
	c := app.AcquireCtx(&fasthttp.RequestCtx{})

	err := c.Redirect().Route("user")
	require.NoError(t, err)
	require.Equal(t, StatusSeeOther, c.Response().StatusCode())
	require.Equal(t, "/user/", string(c.Response().Header.Peek(HeaderLocation)))
}

Domain

Subdomains

Defined In

Frequently Asked Questions

What does Test_Redirect_Route_WithOptionalParamsWithoutValue() do?
Test_Redirect_Route_WithOptionalParamsWithoutValue() is a function in the fiber codebase, defined in redirect_test.go.
Where is Test_Redirect_Route_WithOptionalParamsWithoutValue() defined?
Test_Redirect_Route_WithOptionalParamsWithoutValue() is defined in redirect_test.go at line 138.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free