added counter
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user