mirror of
https://github.com/ditkrg/validates_timeliness.git
synced 2026-01-22 22:06:45 +00:00
remove skipped specs which no longer apply
This commit is contained in:
parent
3bc583b200
commit
e645a938b6
@ -38,21 +38,6 @@ RSpec.describe ValidatesTimeliness::AttributeMethods do
|
||||
expect(e.redefined_birth_date_called).to be_truthy
|
||||
end
|
||||
|
||||
skip 'should be undefined if model class has dynamic attribute methods reset' do
|
||||
# Force method definitions
|
||||
PersonWithShim.validates_date :birth_date
|
||||
r = PersonWithShim.new
|
||||
r.birth_date = Time.now
|
||||
|
||||
write_method = :birth_date=
|
||||
|
||||
expect(PersonWithShim.send(:generated_timeliness_methods).instance_methods).to include(write_method)
|
||||
|
||||
PersonWithShim.undefine_attribute_methods
|
||||
|
||||
expect(PersonWithShim.send(:generated_timeliness_methods).instance_methods).not_to include(write_method)
|
||||
end
|
||||
|
||||
context "with plugin parser" do
|
||||
with_config(:use_plugin_parser, true)
|
||||
|
||||
|
||||
@ -1,5 +1,4 @@
|
||||
RSpec.describe ValidatesTimeliness, 'ActiveRecord' do
|
||||
|
||||
context "validation methods" do
|
||||
let(:record) { Employee.new }
|
||||
|
||||
@ -50,22 +49,6 @@ RSpec.describe ValidatesTimeliness, 'ActiveRecord' do
|
||||
validates_datetime :some_datetime
|
||||
end
|
||||
}
|
||||
|
||||
context 'for column attribute' do
|
||||
skip 'should be detected from column type' do
|
||||
expect(klass.timeliness_attribute_timezone_aware?(:birth_date)).to be_falsey
|
||||
expect(klass.timeliness_attribute_timezone_aware?(:birth_time)).to be_falsey
|
||||
expect(klass.timeliness_attribute_timezone_aware?(:birth_datetime)).to be_truthy
|
||||
end
|
||||
end
|
||||
|
||||
context 'for non-column attribute' do
|
||||
skip 'should be detected from the validation type' do
|
||||
expect(klass.timeliness_attribute_timezone_aware?(:some_date)).to be_falsey
|
||||
expect(klass.timeliness_attribute_timezone_aware?(:some_time)).to be_falsey
|
||||
expect(klass.timeliness_attribute_timezone_aware?(:some_datetime)).to be_truthy
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
context "attribute write method" do
|
||||
|
||||
Loading…
Reference in New Issue
Block a user