summaryrefslogtreecommitdiff
path: root/spec
diff options
context:
space:
mode:
Diffstat (limited to 'spec')
-rw-r--r--spec/models/license_status_spec.rb29
1 files changed, 29 insertions, 0 deletions
diff --git a/spec/models/license_status_spec.rb b/spec/models/license_status_spec.rb
new file mode 100644
index 0000000..09e2319
--- /dev/null
+++ b/spec/models/license_status_spec.rb
@@ -0,0 +1,29 @@
+require "spec_helper"
+
+describe LicenseStatus do
+ describe ".find_match" do
+ it "returns the active status" do
+ LicenseStatus.find_match("active").should == LicenseStatus::ACTIVE
+ LicenseStatus.find_match("ACTIVE").should == LicenseStatus::ACTIVE
+ LicenseStatus.find_match("Active").should == LicenseStatus::ACTIVE
+ end
+
+ it "returns the expired status" do
+ LicenseStatus.find_match("expired").should == LicenseStatus::EXPIRED
+ LicenseStatus.find_match("EXPIRED").should == LicenseStatus::EXPIRED
+ LicenseStatus.find_match("Expired").should == LicenseStatus::EXPIRED
+ end
+
+ it "returns the confidential status" do
+ LicenseStatus.find_match("confidential").should == LicenseStatus::CONFIDENTIAL
+ LicenseStatus.find_match("CONFIDENTIAL").should == LicenseStatus::CONFIDENTIAL
+ LicenseStatus.find_match("Confidential").should == LicenseStatus::CONFIDENTIAL
+ end
+
+ it "returns the active status as the default" do
+ [nil, "", "oh hai"].each do |key|
+ LicenseStatus.find_match(key).should == LicenseStatus::ACTIVE
+ end
+ end
+ end
+end