1
0
Fork 0
mirror of https://github.com/thoughtbot/shoulda-matchers.git synced 2022-11-09 12:01:38 -05:00

fix: issues affecting code quality (#1420)

* use `delegate` for delegation
* Time should be used with zone
This commit is contained in:
Shubhendra Singh Chauhan 2021-04-15 21:14:33 +05:30 committed by GitHub
parent 12dc7cb85c
commit 293a815fbe
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 5 deletions

View file

@ -1,3 +1,4 @@
require 'active_support/core_ext/module/delegation'
module Shoulda module Shoulda
module Matchers module Matchers
module ActionController module ActionController
@ -34,10 +35,7 @@ module Shoulda
expected_value === actual_value expected_value === actual_value
end end
end end
delegate :empty?, to: :flash
def empty?
flash.empty?
end
def use_now! def use_now!
@use_now = true @use_now = true

View file

@ -113,7 +113,7 @@ module Shoulda
case column_type case column_type
when :integer, :float then 1 when :integer, :float then 1
when :decimal then BigDecimal(1, 0) when :decimal then BigDecimal(1, 0)
when :datetime, :time, :timestamp then Time.now when :datetime, :time, :timestamp then Time.current
when :date then Date.new when :date then Date.new
when :binary then '0' when :binary then '0'
else 'an arbitrary value' else 'an arbitrary value'