summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormo khan <mo@mokhan.ca>2014-02-21 23:56:22 -0700
committermo khan <mo@mokhan.ca>2014-02-21 23:56:22 -0700
commit83b84f58d7817077c76970d80a936bc82c086006 (patch)
treea854e58deea9bc30f9dc120a3ade3e2f4f93eedc
parent842ee349392844ff08e818151a8eb5ca00b67d10 (diff)
add specs for expired license.
-rw-r--r--spec/models/license_status/expired_spec.rb12
1 files changed, 12 insertions, 0 deletions
diff --git a/spec/models/license_status/expired_spec.rb b/spec/models/license_status/expired_spec.rb
new file mode 100644
index 0000000..33092f7
--- /dev/null
+++ b/spec/models/license_status/expired_spec.rb
@@ -0,0 +1,12 @@
+require "spec_helper"
+
+describe LicenseStatus::Expired do
+ let!(:active_license) { License.create(issued_at: 1.day.ago, expired_at: 1.day.from_now) }
+ let!(:expired_license) { License.create(issued_at: 2.days.ago, expired_at: 1.day.ago) }
+
+ it "returns expired results" do
+ results = LicenseStatus::Expired.new.filter(License)
+ results.should include(expired_license)
+ results.should_not include(active_license)
+ end
+end