---
url: https://jasperfx.github.io/alba/scenarios/redirects.md
description: >-
  Assert that ASP.NET Core endpoints return temporary or permanent redirects to
  an expected url in Alba scenarios.
---

# Working with Redirects

## Asserting on Expected Redirect Responses

Alba comes with some out of the box assertions to declaratively check expected redirects.

```cs
public async Task asserting_redirects(IAlbaHost system)
{
    await system.Scenario(_ =>
    {
        // should redirect to the url
        _.RedirectShouldBe("/redirect");

        // should redirect permanently to the url
        _.RedirectPermanentShouldBe("/redirect");
    });
}
```

snippet source | anchor
