+ check_json_details(js, user, true, false)
+
+ # check that we can fetch details as JSON with read_email
+ get user_details_path(:format => "json"), :headers => bearer_authorization_header(email_token.token)
+ assert_response :success
+ assert_equal "application/json", response.media_type
+
+ # parse the response
+ js = ActiveSupport::JSON.decode(@response.body)
+ assert_not_nil js
+
+ # check the data that is returned
+ check_json_details(js, user, true, true)