gitlab-org--gitlab-foss/spec/models/term_agreement_spec.rb
tauriedavis 285ffb2238 Messaging on terms page when user already accepted
We show a blue flash banner if the user already accepted, and show a
button allowing them to continue to the application.
2018-06-04 22:22:11 +02:00

17 lines
439 B
Ruby

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