Ruby on Rails - Randomly failing RSpec tests
问题 Sorry for my stupid question. I added the external api to get response in order to check zipcode's validation. app/validators/zipcode_validator.rb class ZipcodeValidator < ActiveModel::Validator def validate(record) record.errors.add(:zipcode, :blank) if record.zipcode.blank? record.errors.add(:zipcode, :not_found) if WmsService.wms_delivery_dates(record.zipcode).nil? end end It works fine in real but failed randomly and took more time when I run rspec. What's the good solution for this