This should be a really simple thing, but I’ve spent the last hour or so googling and haven’t found an answer. I’m writing an API for practice, and I want to test that the response of a
show action is actually the expected.
def show render json: @user, status: :ok end
I’d expect this to pass, but timestamps are formatted different in each part of the expectation, so it fails. So, at the moment, for the test to pass, I’m doing this workaround:
What’d be the correct way to test this? (And, if you know, why do
render json: and
.to_json format timestamps differently?)