require 'spec_helper'

describe SubscriptionDefinitions do


  it "is downgrade " do
    SubscriptionDefinitions.is_downgrade('jamsubgold', 'jamsubplatinum').should be_true
    SubscriptionDefinitions.is_downgrade('jamsubplatinum', 'jamsubgold').should be_false
    SubscriptionDefinitions.is_downgrade('jamsubgold', 'jamsubgold').should be_false
    SubscriptionDefinitions.is_downgrade('jamsubgold', 'jamsubgoldyearly').should be_false
    SubscriptionDefinitions.is_downgrade('jamsubgoldyearly', 'jamsubgold').should be_false
    SubscriptionDefinitions.is_downgrade(nil, 'jamsubgold').should be_true
    SubscriptionDefinitions.is_downgrade('jamsubsilver', nil).should be_false
    SubscriptionDefinitions.is_downgrade('jamsubsilveryearly', nil).should be_false
  end
end
