Skip to content

Commit

Permalink
use dedicated denied message for anonymized memberships
Browse files Browse the repository at this point in the history
  • Loading branch information
wiese committed Feb 13, 2018
1 parent b237285 commit 0768071
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 13 deletions.
8 changes: 4 additions & 4 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions skins/10h16/templates/Access_Denied.twig
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{% extends 'Base_Layout.html.twig' %}

{% block main %}
{$ message|default( 'access_denied' )|trans() $}
{% endblock %}
{$ message | default( 'access_denied' ) | trans | raw $}
{% endblock %}
2 changes: 1 addition & 1 deletion skins/cat17/templates/Access_Denied.twig
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
<h1>{$ 'access_denied_header' | trans $}</h1>

<p>
{$ message | default( 'access_denied' ) | trans $}
{$ message | default( 'access_denied' ) | trans | raw $}
</p>

<p>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ private function mapStatus( bool $isConfirmed ): string {
}

public function presentApplicationWasAnonymized(): void {
$this->exception = new AccessDeniedException( 'access_denied_membership_confirmation' );
$this->exception = new AccessDeniedException( 'access_denied_membership_confirmation_anonymized' );
}

public function presentAccessViolation(): void {
Expand Down
10 changes: 5 additions & 5 deletions tests/EdgeToEdge/Routes/ShowMembershipConfirmationRouteTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ public function testCallWithWrongAccessToken_deniedPageIsShown(): void {
]
);

$this->assertAccessIsDenied( $client );
$this->assertAccessIsDenied( 'access_denied_membership_confirmation', $client );
} );
}

Expand All @@ -99,7 +99,7 @@ public function testCallOnAnonymizedRecord_deniedPageIsShown(): void {
]
);

$this->assertAccessIsDenied( $client );
$this->assertAccessIsDenied( 'access_denied_membership_confirmation_anonymized', $client );
} );
}

Expand All @@ -114,7 +114,7 @@ public function testCallOnUnknownApplicationId_deniedPageIsShown(): void {
]
);

$this->assertAccessIsDenied( $client );
$this->assertAccessIsDenied( 'access_denied_membership_confirmation', $client );
} );
}

Expand Down Expand Up @@ -154,8 +154,8 @@ public function testOnDatabaseError_errorPageIsShown(): void {
$this->assertTrue( $client->getResponse()->isServerError() );
}

private function assertAccessIsDenied( Client $client ): void {
$this->assertContains( 'access_denied_membership_confirmation', $client->getResponse()->getContent() );
private function assertAccessIsDenied( string $expectedMessage, Client $client ): void {
$this->assertContains( $expectedMessage, $client->getResponse()->getContent() );
$this->assertTrue( $client->getResponse()->isForbidden() );
}

Expand Down

0 comments on commit 0768071

Please sign in to comment.