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:
parent
12dc7cb85c
commit
293a815fbe
2 changed files with 3 additions and 5 deletions
|
@ -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
|
||||||
|
|
|
@ -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'
|
||||||
|
|
Loading…
Reference in a new issue