debian-mirror-gitlab/spec/models/term_agreement_spec.rb

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

20 lines
476 B
Ruby
Raw Normal View History

2019-07-07 11:18:12 +05:30
# frozen_string_literal: true
2018-10-15 14:42:47 +05:30
require 'spec_helper'
2020-07-28 23:09:34 +05:30
RSpec.describe TermAgreement do
2018-10-15 14:42:47 +05:30
describe 'validations' do
it { is_expected.to validate_presence_of(:term) }
it { is_expected.to validate_presence_of(:user) }
end
2018-11-08 19:23:39 +05:30
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-10-15 14:42:47 +05:30
end