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