diff --git a/spec/routing/hostname_constraints_spec.rb b/spec/routing/hostname_constraints_spec.rb index 6f042a6..7cc5779 100644 --- a/spec/routing/hostname_constraints_spec.rb +++ b/spec/routing/hostname_constraints_spec.rb @@ -16,4 +16,19 @@ action: 'new' ) end + + example 'ホスト名が対象外なら errors/not_foundへ' do + expect(get: 'http://foo.example.jp').to route_to( + controller: 'errors', + action: 'routing_error' + ) + end + + example '存在しないパスならerrors/not_foundへ' do + expect(get: 'http://baukis.example.com/xyz').to route_to( + controller: 'errors', + action: 'routing_error', + anything: 'xyz' + ) + end end