diff options
Diffstat (limited to 'spec/models/group_deploy_token_spec.rb')
-rw-r--r-- | spec/models/group_deploy_token_spec.rb | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/spec/models/group_deploy_token_spec.rb b/spec/models/group_deploy_token_spec.rb new file mode 100644 index 00000000000..d38abafa7ed --- /dev/null +++ b/spec/models/group_deploy_token_spec.rb @@ -0,0 +1,17 @@ +# frozen_string_literal: true + +require 'spec_helper' + +RSpec.describe GroupDeployToken, type: :model do + let(:group) { create(:group) } + let(:deploy_token) { create(:deploy_token) } + + subject(:group_deploy_token) { create(:group_deploy_token, group: group, deploy_token: deploy_token) } + + it { is_expected.to belong_to :group } + it { is_expected.to belong_to :deploy_token } + + it { is_expected.to validate_presence_of :deploy_token } + it { is_expected.to validate_presence_of :group } + it { is_expected.to validate_uniqueness_of(:deploy_token_id).scoped_to(:group_id) } +end |