Ignore deleted devices while showing the App usage report

This commit is contained in:
Leena
2016-03-07 08:47:28 +05:30
parent 129f280723
commit 6f4894351d
2 changed files with 10 additions and 0 deletions

View File

@@ -7,4 +7,13 @@ RSpec.describe AppUsage, type: :model do
it { should validate_presence_of :usage_duration_in_seconds }
it { should validate_presence_of :used_on }
it { should belong_to :device }
context "App Usage report" do
let!(:app_usage) { create(:app_usage,device_id: nil) }
it "Ignore Deleted devices" do
app_usage = AppUsage.app_usages_per_device_app_day
expect(app_usage).to be_empty
end
end
end