properties: email: type: string status: type: string enum: - active - suspended # ... # spec/requests/users_spec.rb # Θ͟ͱemailΛؚΊͳ͍࣮ʹରͯ͠Request SpecΛ࣮ߦ RSpec.describe 'Users', type: :request do describe 'GET /users/:id' do it 'returns a valid response' do get "/users/#{user.id}" # ... end end end
process(*args) super *args # ... assert_schema_conform end end end )551Ϩεϙϯεऔಘޙʹassert_schema_conformΛ ࣮ߦ͢ΔϝιουΛ࣋ͭϞδϡʔϧΛprependͯ͠ಈ࡞Λॻ͖͑✌ # lib/action_dispatch/integration.rb module ActionDispatch module Integration class Session prepend SchemaConformist::ProcessWithAssertion end end end