summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormo khan <mo@mokhan.ca>2014-02-22 08:18:15 -0700
committermo khan <mo@mokhan.ca>2014-02-22 08:18:15 -0700
commit1de5ac98002e9057bd5a163deb93f630464185fc (patch)
treec8b0830ca99c6c754d0d2a10a6154063c03dcb0e
parentba07bb7f1ea83845cfd8e0fdae5f860087147b5c (diff)
pretty print the active status name.
-rw-r--r--app/models/license_status/active.rb6
-rw-r--r--spec/models/license_status/active_spec.rb4
2 files changed, 9 insertions, 1 deletions
diff --git a/app/models/license_status/active.rb b/app/models/license_status/active.rb
index aea5652..864ee1a 100644
--- a/app/models/license_status/active.rb
+++ b/app/models/license_status/active.rb
@@ -5,7 +5,11 @@ class LicenseStatus::Active
end
def matches?(name)
- "active" == name
+ to_s == name
+ end
+
+ def to_s
+ 'active'
end
end
diff --git a/spec/models/license_status/active_spec.rb b/spec/models/license_status/active_spec.rb
index 21764dc..4d44737 100644
--- a/spec/models/license_status/active_spec.rb
+++ b/spec/models/license_status/active_spec.rb
@@ -10,4 +10,8 @@ describe LicenseStatus::Active do
results.should include(active_license)
results.should_not include(expired_license)
end
+
+ it "returns it's name" do
+ subject.to_s.should == 'active'
+ end
end