It is a memorandum.
OrderForm Product purchase When the product purchase goes well You can purchase if the following 7 items exist → zicide, prefecture_id, city, address, phone_number, user_id, item_id Can be purchased even if the building name is empty When product purchase does not go well Cannot be purchased if the zip code is empty Cannot be purchased without a hyphen in the zip code Cannot be purchased if the phone number has a hyphen(FAILED - 1) You can only purchase if your phone number is within 11 digits(FAILED - 2) Failures: 1)OrderForm Product purchase When product purchase is not successful You cannot purchase if there is a hyphen in the phone number Failure/Error: _query(sql, @query_options.merge(options)) ActiveRecord::StatementInvalid: Mysql2::Error::ConnectionError: Lost connection to MySQL server during query
There is an error in Mysql. Probably, it's possible that you've loaded something later than the data that should be loaded first, causing an error.
require 'rails_helper' describe OrderForm do before do @order = FactoryBot.build(:order_form) sleep(1) end
I decided to do a test process every second so that nothing would be read first. I was able to avoid the error by adding sleep (1) to the test description.