Implement Person#party_supporter?
This commit is contained in:
parent
f356c13371
commit
6bc4dfbcad
2 changed files with 13 additions and 1 deletions
|
@ -18,7 +18,7 @@ class Person < ApplicationRecord
|
|||
end
|
||||
|
||||
def party_supporter?
|
||||
false
|
||||
supporter_since.present?
|
||||
end
|
||||
|
||||
def party_member?
|
||||
|
|
|
@ -40,4 +40,16 @@ RSpec.describe Person do
|
|||
it { is_expected.not_to allow_value 1.day.from_now.to_date }
|
||||
it { is_expected.not_to allow_value rand(10_000).days.from_now.to_date }
|
||||
end
|
||||
|
||||
describe '#party_supporter?' do
|
||||
let(:result) { subject.party_supporter? }
|
||||
|
||||
specify { expect(result).to eq false }
|
||||
|
||||
context 'for party supporter' do
|
||||
subject { create :supporter_person }
|
||||
|
||||
specify { expect(result).to eq true }
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Reference in a new issue