1
0
Fork 0

Implement Person#party_supporter?

This commit is contained in:
Alex Kotov 2018-12-15 11:03:44 +05:00
parent f356c13371
commit 6bc4dfbcad
No known key found for this signature in database
GPG Key ID: 4E831250F47DE154
2 changed files with 13 additions and 1 deletions

View File

@ -18,7 +18,7 @@ class Person < ApplicationRecord
end
def party_supporter?
false
supporter_since.present?
end
def party_member?

View File

@ -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