summaryrefslogtreecommitdiff
path: root/spec/models/license_status/expired_spec.rb
blob: ed5ea5de01382fceb028b0a637babc9480a22b82 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
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

  it "returns it's name" do
    subject.to_s.should == 'expired'
  end
end