'When multiple redirects exist under a single prefix, the longest match
is listed first.'

@given(hostname=text())
def test_long_match_first(self, hostname):

    rules = parse_routing_rules({'long/': {'est/first/': {'replace_key': 'there'}, '': {'replace_key': 'here'}}, '': {'long/est/': {'replace_key': 'everywhere'}}}, hostname)
    self.assertThat(rules, MatchesRoutingRules([RoutingRule.when(key_prefix='long/est/first/').then_redirect(hostname=hostname, protocol='https', replace_key='long/there', http_redirect_code=302), RoutingRule.when(key_prefix='long/est/').then_redirect(hostname=hostname, protocol='https', replace_key='everywhere', http_redirect_code=302), RoutingRule.when(key_prefix='long/').then_redirect(hostname=hostname, protocol='https', replace_key='long/here', http_redirect_code=302)]))
