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 Matchers
module ActionController
@ -34,10 +35,7 @@ module Shoulda
expected_value === actual_value
end
end
def empty?
flash.empty?
end
delegate :empty?, to: :flash
def use_now!
@use_now = true

View file

@ -113,7 +113,7 @@ module Shoulda
case column_type
when :integer, :float then 1
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 :binary then '0'
else 'an arbitrary value'