Permalink
Browse files

eliminamos las verificaciones con fecha de vigencia desconocida

  • Loading branch information...
manuel-rabade committed Aug 26, 2014
1 parent 5128e07 commit e4ed9d506cf6dfdb529f564b513f4e9bc534dc2e
@@ -27,18 +27,6 @@
llevar tu auto a verificar.</p>
<% end %>
<% if @vehicle.verificacion_unknown? %>
<!-- verificacion desconocida -->
<%= icon(:warning) %>
<p class="msg"><strong>No tenemos disponible la vigencia de tu última
verificación.</strong>
</p>
<p class="msg">Para verificaciónes con resultado <strong>doble
cero</strong> previas al segundo semestre de 2012 debes
determinar su vigencía a partir de la fecha de compra de tu
auto.</p>
<% end %>
<% if @vehicle.verificacion_first_ok? %>
<!-- en periodo para 1a verificacion -->
<%= icon(:warning) %>
@@ -300,36 +300,24 @@ def verificacion_first_end
def verificacion_ok?
return false unless self.verificaciones_approved?
return false if self.verificacion_unknown?
return false if self.verificacion_expired?
return false if self.verificacion_period?
true
end
def verificacion_period?
return false unless self.verificaciones_approved?
return false if self.verificacion_unknown?
return false if self.verificacion_expired?
return true if self.verificacion_current_period <= Date.today
false
end
def verificacion_expired?
return false unless self.verificaciones_approved?
return false if self.verificacion_unknown?
return true if self.verificacion_current_vigency <= Date.today
false
end
def verificacion_unknown?
return false unless self.verificacion_last_approved?
if self.verificacion_last_approved['equipo_gdf'] == '0' &&
self.verificacion_last_approved['resultado'] =~ /doble cero/i
return true
end
false
end
def verificacion_first_ok?
return false unless self.registration_date_valid?
return true if verificacion_first_end > Date.today
@@ -346,7 +334,11 @@ def verificacion_first_expired?
def verificacion_current_expired_str
return false unless self.verificacion_current?
I18n.localize(self.verificacion_current_vigency + 1, :format => :long)
if self.verificacion_current['equipo_gdf'] == '1'
I18n.localize(self.verificacion_current_vigency + 1, :format => :long)
else
I18n.localize(self.verificacion_current_vigency, :format => :long)
end
end
def verificacion_current_vigency_str
@@ -402,11 +394,7 @@ def verificaciones_all
r.fuel = v['combustible'].capitalize
r.cert = v['certificado']
r.cancel = v['cancelado'] == 'SI' ? true : false
if v['equipo_gdf'] == '0' && v['resultado'] =~ /doble cero/i
r.vigency = 'No disponible'
else
r.vigency = I18n.localize(Date.parse(v['vigencia']), :format => :default)
end
r.vigency = I18n.localize(Date.parse(v['vigencia']), :format => :default)
r.result = v['resultado']
r.reject = v['casua_rechazo']
r
@@ -12,7 +12,6 @@
expect(subject.verificacion_ok?).to eq(true)
expect(subject.verificacion_period?).to eq(false)
expect(subject.verificacion_expired?).to eq(false)
expect(subject.verificacion_unknown?).to eq(false)
expect(subject.verificacion_first_ok?).to eq(false)
expect(subject.verificacion_first_expired?).to eq(false)
end
@@ -23,7 +22,6 @@
expect(subject.verificacion_ok?).to eq(false)
expect(subject.verificacion_period?).to eq(true)
expect(subject.verificacion_expired?).to eq(false)
expect(subject.verificacion_unknown?).to eq(false)
expect(subject.verificacion_first_ok?).to eq(false)
expect(subject.verificacion_first_expired?).to eq(false)
end
@@ -34,18 +32,6 @@
expect(subject.verificacion_ok?).to eq(false)
expect(subject.verificacion_period?).to eq(false)
expect(subject.verificacion_expired?).to eq(true)
expect(subject.verificacion_unknown?).to eq(false)
expect(subject.verificacion_first_ok?).to eq(false)
expect(subject.verificacion_first_expired?).to eq(false)
end
end
shared_examples 'verificacion unknown' do
it 'verificacion_unknown? should return true' do
expect(subject.verificacion_ok?).to eq(false)
expect(subject.verificacion_period?).to eq(false)
expect(subject.verificacion_expired?).to eq(false)
expect(subject.verificacion_unknown?).to eq(true)
expect(subject.verificacion_first_ok?).to eq(false)
expect(subject.verificacion_first_expired?).to eq(false)
end
@@ -56,7 +42,6 @@
expect(subject.verificacion_ok?).to eq(false)
expect(subject.verificacion_period?).to eq(false)
expect(subject.verificacion_expired?).to eq(false)
expect(subject.verificacion_unknown?).to eq(false)
expect(subject.verificacion_first_ok?).to eq(true)
expect(subject.verificacion_first_expired?).to eq(false)
end
@@ -67,7 +52,6 @@
expect(subject.verificacion_ok?).to eq(false)
expect(subject.verificacion_period?).to eq(false)
expect(subject.verificacion_expired?).to eq(false)
expect(subject.verificacion_unknown?).to eq(false)
expect(subject.verificacion_first_ok?).to eq(false)
expect(subject.verificacion_first_expired?).to eq(true)
end
@@ -128,7 +112,6 @@
expect(subject.verificacion_ok?).to eq(false)
expect(subject.verificacion_period?).to eq(false)
expect(subject.verificacion_expired?).to eq(false)
expect(subject.verificacion_unknown?).to eq(false)
expect(subject.verificacion_first_ok?).to eq(false)
expect(subject.verificacion_first_expired?).to eq(false)
expect(subject.no_circula_cero?).to eq(false)
@@ -246,17 +229,6 @@
it_should_behave_like 'no adeudos'
end
context 'verificacion unknown' do
before do
stub_datalab('verificacion_unknown')
@vehicle = VehicleCDMX.new({ plate: '123ABC' })
end
it_should_behave_like 'vehicle cdmx ok'
it_should_behave_like 'verificacion unknown'
it_should_behave_like 'no circula cero'
it_should_behave_like 'no adeudos'
end
context 'verificacion none' do
before do
stub_datalab('verificacion_none')

This file was deleted.

Oops, something went wrong.

0 comments on commit e4ed9d5

Please sign in to comment.