Skip to content

Commit

Permalink
fix to APN::App tests
Browse files Browse the repository at this point in the history
  • Loading branch information
PRXci committed Nov 9, 2010
1 parent 14897be commit fec9599
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions spec/apn_on_rails/app/models/apn/app_spec.rb
Expand Up @@ -166,6 +166,10 @@
devices = [DeviceFactory.create(:app_id => app.id, :last_registered_at => 1.week.ago, :feedback_at => Time.now),
DeviceFactory.create(:app_id => app.id, :last_registered_at => 1.week.from_now, :feedback_at => Time.now)]
puts "device ids are #{devices[0].id} and #{devices[1].id}"
devices[0].last_registered_at = 1.week.ago
devices[0].save
devices[1].last_registered_at = 1.week.from_now
devices[1].save
APN::Feedback.should_receive(:devices).twice.and_return(devices)
APN::App.should_receive(:all).and_return([app])
app.should_receive(:cert).twice.and_return(app.apn_dev_cert)
Expand All @@ -181,6 +185,7 @@
it 'should destroy devices that have a last_registered_at date that is before the feedback_at date that have no app' do
device = DeviceFactory.create(:app_id => nil, :last_registered_at => 1.week.ago, :feedback_at => Time.now)
device.app_id = nil
device.last_registered_at = 1.week.ago
device.save
APN::Feedback.should_receive(:devices).and_return([device])
APN::App.should_receive(:all).and_return([])
Expand Down

0 comments on commit fec9599

Please sign in to comment.