나는 내일의 날짜 (1.date.from_now)를 보내는 방법이 있습니다. 내 사양에서 동일한 방법을 테스트하고있다. 누구든지 그 날짜를 스텁하는 법을 말해 줄 수 있어요.rspec에서 내일 스텁하기
지금 내가 1.date.from을 통과하면. 다음 오류가 발생했습니다. 아래
<S3Client (class)> received :upload_csv_by_path with unexpected arguments
expected: ("/home/projects/sh/tmp/test_exporter.csv", nil, {:expires=>Sat, 07 Feb 2015 11:36:39 UTC +00:00})
got: ("/home/projects/sh/tmp/test_exporter.csv", nil, {:expires=>Sat, 07 Feb 2015 11:36:39 UTC +00:00})
내 방법입니다
다음
S3Client.upload_csv_by_path(file_name, nil, expires: 1.day.from_now)
내 사양은,
S3Client.should_receive(:upload_csv_by_path).with("#{Rails.root}/tmp/scalar_test_exporter.csv", nil, expires: 1.day.from_now)
사람이 내가 Time.now를 사용하여 해결이 문제
해결했습니다. 감사합니다 – user3655415
보석을보세요 [timecop] (https://github.com/travisjeffery/timecop) – gotva