Updated Branches: refs/heads/master 25fb703a6 -> f85d620e7
Removed test from deleted code Project: http://git-wip-us.apache.org/repos/asf/incubator-blur/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-blur/commit/f85d620e Tree: http://git-wip-us.apache.org/repos/asf/incubator-blur/tree/f85d620e Diff: http://git-wip-us.apache.org/repos/asf/incubator-blur/diff/f85d620e Branch: refs/heads/master Commit: f85d620e7b0f27936f642be53e9035f06e6e80a2 Parents: 25fb703 Author: Chris Rohr <[email protected]> Authored: Thu Sep 26 20:49:25 2013 -0400 Committer: Chris Rohr <[email protected]> Committed: Thu Sep 26 20:49:25 2013 -0400 ---------------------------------------------------------------------- .../spec/helpers/license_helper_spec.rb | 107 ------------------- 1 file changed, 107 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-blur/blob/f85d620e/contrib/blur-console/blur-admin/spec/helpers/license_helper_spec.rb ---------------------------------------------------------------------- diff --git a/contrib/blur-console/blur-admin/spec/helpers/license_helper_spec.rb b/contrib/blur-console/blur-admin/spec/helpers/license_helper_spec.rb deleted file mode 100644 index 81d6a7f..0000000 --- a/contrib/blur-console/blur-admin/spec/helpers/license_helper_spec.rb +++ /dev/null @@ -1,107 +0,0 @@ -# Licensed to the Apache Software Foundation (ASF) under one or more -# contributor license agreements. See the NOTICE file distributed with this -# work for additional information regarding copyright ownership. The ASF -# licenses this file to you under the Apache License, Version 2.0 (the -# "License"); you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT -# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the -# License for the specific language governing permissions and limitations -# under the License. - -require 'spec_helper' -include ApplicationHelper - -describe LicenseHelper do - before(:each) do - @license = FactoryGirl.create :license - end - describe "license text" do - before(:each) do - @prefix = "Licensed to: NIC on #{@license.issued_date.strftime('%d %b %Y')}." - end - - describe 'License expiration' do - it 'should state no warning when the license will expire in more than 30 days' do - license_text(@license).should == @prefix - end - - it 'should return No license found when the license is nil' do - license_text(nil).should == 'No valid license found.' - end - - it 'should state that the license is expired when the number of days left is less than 0' do - @license.stub!(:expires_date).and_return Date.today.months_ago(1) - license_text(@license).should == @prefix + ' License is expired.' - end - - it 'should state that the license is about to expire today when the number of days left is 0' do - @license.stub!(:expires_date).and_return Date.today - license_text(@license).should == @prefix + ' License expires today.' - end - - it 'should state that the license will expire in x days when the number of days left is x and x is less than 30' do - @license.stub!(:expires_date).and_return Date.today.weeks_ago(-1) - license_text(@license).should == @prefix + ' License expires in 7 days.' - end - end - - describe 'Node Overage' do - before(:each) do - @license.stub!(:node_overage).and_return 1 - end - - it 'should warn that you have a node overage and if you are over teh grace period then tell you to contact nic' do - @license.stub!(:grace_period_days_remain).and_return -2 - license_text(@license).should == @prefix + ' There is currently 1 node over the licensed amount. Please contact Near Infinity to upgrade the license.' - end - - it 'should warn that you have a node overage and get the correct pluralization' do - @license.stub!(:node_overage).and_return 2 - @license.stub!(:grace_period_days_remain).and_return -2 - license_text(@license).should == @prefix + ' There are currently 2 nodes over the licensed amount. Please contact Near Infinity to upgrade the license.' - end - - it 'should warn that you have a node overage and if you are within the grace period then it should tell you how many days are left' do - @license.stub!(:grace_period_days_remain).and_return 3 - license_text(@license).should == @prefix + ' There is currently 1 node over the licensed amount. 3 days left until a new license is needed.' - end - end - - describe 'cluster overage' do - it 'should warn of a cluster overage if there are any clusters that have expired' do - @license.stub!(:cluster_overage).and_return 1 - license_text(@license).should == @prefix + ' There is currently 1 cluster over the licensed amount. Please contact Near Infinity to upgrade the license.' - end - - it 'should warn of a cluster overage if there are any clusters that have expired with correct pluralization' do - @license.stub!(:cluster_overage).and_return 2 - license_text(@license).should == @prefix + ' There are currently 2 clusters over the licensed amount. Please contact Near Infinity to upgrade the license.' - end - end - end - - describe "footer class" do - it 'should return false if the license is fine' do - footer_class(@license).should == false - end - - it 'should return expiring_license if the license is nil' do - footer_class(nil).should == 'expiring_license' - end - - it 'should return expiring_license if it is within 30 days of expiring or has expired, or if there is a cluster overage' do - @license.stub!(:expires_date).and_return Date.today.weeks_ago(-1) - footer_class(@license).should == 'expiring_license' - end - - it 'should return expiring_license if there is a cluster overage' do - @license.stub!(:cluster_overage).and_return 1 - footer_class(@license).should == 'expiring_license' - end - end -end \ No newline at end of file
