mirror of
https://github.com/ditkrg/validates_timeliness.git
synced 2026-01-22 13:56:48 +00:00
Getting with the RSpec times
This commit is contained in:
parent
244f398cc4
commit
d57c64dcc2
1
.rspec
1
.rspec
@ -1,3 +1,4 @@
|
||||
--format documentation
|
||||
--color
|
||||
--require spec_helper
|
||||
--require byebug
|
||||
|
||||
@ -1,6 +1,4 @@
|
||||
require 'spec_helper'
|
||||
|
||||
describe ValidatesTimeliness::AttributeMethods do
|
||||
RSpec.describe ValidatesTimeliness::AttributeMethods do
|
||||
it 'should define read_timeliness_attribute_before_type_cast instance method' do
|
||||
expect(PersonWithShim.new).to respond_to(:read_timeliness_attribute_before_type_cast)
|
||||
end
|
||||
|
||||
@ -1,6 +1,4 @@
|
||||
require 'spec_helper'
|
||||
|
||||
describe ValidatesTimeliness::Conversion do
|
||||
RSpec.describe ValidatesTimeliness::Conversion do
|
||||
include ValidatesTimeliness::Conversion
|
||||
|
||||
let(:options) { Hash.new }
|
||||
|
||||
@ -1,6 +1,4 @@
|
||||
require 'spec_helper'
|
||||
|
||||
describe 'ValidatesTimeliness::Extensions::DateTimeSelect' do
|
||||
RSpec.describe 'ValidatesTimeliness::Extensions::DateTimeSelect' do
|
||||
include ActionView::Helpers::DateHelper
|
||||
attr_reader :person, :params
|
||||
|
||||
|
||||
@ -1,6 +1,4 @@
|
||||
require 'spec_helper'
|
||||
|
||||
describe 'ValidatesTimeliness::Extensions::MultiparameterHandler' do
|
||||
RSpec.describe 'ValidatesTimeliness::Extensions::MultiparameterHandler' do
|
||||
|
||||
context "time column" do
|
||||
it 'should assign a string value for invalid date portion' do
|
||||
|
||||
@ -1,6 +1,4 @@
|
||||
require 'spec_helper'
|
||||
|
||||
describe ValidatesTimeliness, 'HelperMethods' do
|
||||
RSpec.describe ValidatesTimeliness, 'HelperMethods' do
|
||||
let(:record) { Person.new }
|
||||
|
||||
it 'should define class validation methods' do
|
||||
|
||||
@ -1,6 +1,4 @@
|
||||
require 'spec_helper'
|
||||
|
||||
describe ValidatesTimeliness, 'ActiveRecord' do
|
||||
RSpec.describe ValidatesTimeliness, 'ActiveRecord' do
|
||||
|
||||
context "validation methods" do
|
||||
let(:record) { Employee.new }
|
||||
|
||||
@ -1,6 +1,4 @@
|
||||
require 'spec_helper'
|
||||
|
||||
describe ValidatesTimeliness::Validator, ":after option" do
|
||||
RSpec.describe ValidatesTimeliness::Validator, ":after option" do
|
||||
describe "for date type" do
|
||||
before do
|
||||
Person.validates_date :birth_date, :after => Date.new(2010, 1, 1)
|
||||
|
||||
@ -1,6 +1,4 @@
|
||||
require 'spec_helper'
|
||||
|
||||
describe ValidatesTimeliness::Validator, ":before option" do
|
||||
RSpec.describe ValidatesTimeliness::Validator, ":before option" do
|
||||
describe "for date type" do
|
||||
before do
|
||||
Person.validates_date :birth_date, :before => Date.new(2010, 1, 1)
|
||||
|
||||
@ -1,6 +1,4 @@
|
||||
require 'spec_helper'
|
||||
|
||||
describe ValidatesTimeliness::Validator, ":is_at option" do
|
||||
RSpec.describe ValidatesTimeliness::Validator, ":is_at option" do
|
||||
before do
|
||||
Timecop.freeze(Time.local(2010, 1, 1, 0, 0, 0))
|
||||
end
|
||||
|
||||
@ -1,6 +1,4 @@
|
||||
require 'spec_helper'
|
||||
|
||||
describe ValidatesTimeliness::Validator, ":on_or_after option" do
|
||||
RSpec.describe ValidatesTimeliness::Validator, ":on_or_after option" do
|
||||
describe "for date type" do
|
||||
before do
|
||||
Person.validates_date :birth_date, :on_or_after => Date.new(2010, 1, 1)
|
||||
|
||||
@ -1,6 +1,4 @@
|
||||
require 'spec_helper'
|
||||
|
||||
describe ValidatesTimeliness::Validator, ":on_or_before option" do
|
||||
RSpec.describe ValidatesTimeliness::Validator, ":on_or_before option" do
|
||||
describe "for date type" do
|
||||
before do
|
||||
Person.validates_date :birth_date, :on_or_before => Date.new(2010, 1, 1)
|
||||
|
||||
@ -1,6 +1,4 @@
|
||||
require 'spec_helper'
|
||||
|
||||
describe ValidatesTimeliness::Validator do
|
||||
RSpec.describe ValidatesTimeliness::Validator do
|
||||
before do
|
||||
Timecop.freeze(Time.local(2010, 1, 1, 0, 0, 0))
|
||||
end
|
||||
|
||||
@ -1,6 +1,4 @@
|
||||
require 'spec_helper'
|
||||
|
||||
describe ValidatesTimeliness do
|
||||
RSpec.describe ValidatesTimeliness do
|
||||
|
||||
it 'should alias use_euro_formats to remove_us_formats on Timeliness gem' do
|
||||
expect(Timeliness).to respond_to(:remove_us_formats)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user