added counter

This commit is contained in:
2015-10-19 08:25:26 +02:00
parent bffa85f28e
commit 2f45cbd558
5 changed files with 41 additions and 0 deletions
+12
View File
@@ -10,4 +10,16 @@ describe Supporter do
it { is_expected.to validate_uniqueness_of(:email) }
it { is_expected.to validate_presence_of(:support) }
it { is_expected.to validate_presence_of(:age_category) }
describe '.counter' do
it 'counts only from a certain number on' do
allow(Supporter).to receive(:count) { 12 }
expect(Supporter.counter).to eq Supporter::COUNTER_START
allow(Supporter).to receive(:count) { Supporter::COUNTER_START + 12 }
expect(Supporter.counter).to eq Supporter::COUNTER_START + 12
end
end
end