Add API datetime/format matcher for serialization specs, reduce factories (#33325)
This commit is contained in:
parent
978142ac9e
commit
ce5c33c65d
26 changed files with 127 additions and 96 deletions
8
spec/support/matchers/api_datetime_format.rb
Normal file
8
spec/support/matchers/api_datetime_format.rb
Normal file
|
@ -0,0 +1,8 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
RSpec::Matchers.define :match_api_datetime_format do
|
||||
match(notify_expectation_failures: true) do |value|
|
||||
expect { DateTime.rfc3339(value) }
|
||||
.to_not raise_error
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue