The coalescences of stellar-mass black-hole binaries through their inspiral, merger, and ringdown are among the most promising sources for ground-based gravitational-wave (GW) detectors. If a GW signal is observed with sufficient signal-to-noise ratio, the masses and spins of the black holes can be estimated from just the inspiral part of the signal. Using these estimates of the initial parameters of the binary, the mass and spin of the final black hole can be uniquely predicted making use of general-relativistic numerical simulations. In addition, the mass and spin of the final black hole can be independently estimated from the merger-ringdown part of the signal. If the binary black-hole dynamics is correctly described by general relativity (GR), these independent estimates have to be consistent with each other. We present a Bayesian implementation of such a test of general relativity, which allows us to combine the constraints from multiple observations. Using kludge modified GR waveforms, we demonstrate that this test can detect sufficiently large deviations from GR and outline the expected constraints from upcoming GW observations using the second-generation of ground-based GW detectors.