forked from softace/validates_timeliness
-
Notifications
You must be signed in to change notification settings - Fork 0
/
validates_timeliness_spec.rb
43 lines (35 loc) · 1.4 KB
/
validates_timeliness_spec.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
require 'spec_helper'
describe ValidatesTimeliness do
it 'should alias use_euro_formats to remove_us_formats on Timeliness gem' do
Timeliness.should respond_to(:remove_us_formats)
end
it 'should alias to date_for_time_type to dummy_date_for_time_type on Timeliness gem' do
Timeliness.should respond_to(:dummy_date_for_time_type)
end
describe "config" do
it 'should delegate default_timezone to Timeliness gem' do
Timeliness.should_receive(:default_timezone=)
ValidatesTimeliness.default_timezone = :utc
end
it 'should delegate dummy_date_for_time_type to Timeliness gem' do
Timeliness.should_receive(:dummy_date_for_time_type)
Timeliness.should_receive(:dummy_date_for_time_type=)
array = ValidatesTimeliness.dummy_date_for_time_type
ValidatesTimeliness.dummy_date_for_time_type = array
end
context "parser" do
it 'should delegate add_formats to Timeliness gem' do
Timeliness.should_receive(:add_formats)
ValidatesTimeliness.parser.add_formats
end
it 'should delegate remove_formats to Timeliness gem' do
Timeliness.should_receive(:remove_formats)
ValidatesTimeliness.parser.remove_formats
end
it 'should delegate remove_us_formats to Timeliness gem' do
Timeliness.should_receive(:remove_us_formats)
ValidatesTimeliness.parser.remove_us_formats
end
end
end
end