OpenProject is the leading open source project management software.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
openproject/modules/ldap_groups/spec/models/synchronized_group_spec.rb

23 lines
682 B

require 'spec_helper'
describe LdapGroups::SynchronizedGroup, type: :model do
subject { FactoryBot.build :ldap_synchronized_group }
describe 'validations' do
context 'correct attributes' do
it 'saves the record' do
expect(subject.save).to eq true
end
end
context 'missing attributes' do
subject { described_class.new }
it 'validates missing attributes' do
expect(subject.save).to eq false
expect(subject.errors[:dn]).to include "can't be blank."
expect(subject.errors[:auth_source]).to include "can't be blank."
expect(subject.errors[:group]).to include "can't be blank."
end
end
end
end