2018-04-25 04:55:53 -04:00
|
|
|
require 'spec_helper'
|
|
|
|
|
|
|
|
describe TermAgreement do
|
|
|
|
describe 'validations' do
|
|
|
|
it { is_expected.to validate_presence_of(:term) }
|
|
|
|
it { is_expected.to validate_presence_of(:user) }
|
|
|
|
end
|
2018-05-25 19:17:57 -04:00
|
|
|
|
|
|
|
describe '.accepted' do
|
|
|
|
it 'only includes accepted terms' do
|
|
|
|
accepted = create(:term_agreement, :accepted)
|
|
|
|
create(:term_agreement, :declined)
|
|
|
|
|
|
|
|
expect(described_class.accepted).to contain_exactly(accepted)
|
|
|
|
end
|
|
|
|
end
|
2018-04-25 04:55:53 -04:00
|
|
|
end
|