2019-03-30 03:23:56 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2019-08-29 03:56:52 -04:00
|
|
|
require 'spec_helper'
|
2018-04-05 13:22:34 -04:00
|
|
|
|
|
|
|
RSpec.describe ProjectDeployToken, type: :model do
|
|
|
|
let(:project) { create(:project) }
|
|
|
|
let(:deploy_token) { create(:deploy_token) }
|
2019-12-18 19:08:01 -05:00
|
|
|
|
2018-04-05 13:22:34 -04:00
|
|
|
subject(:project_deploy_token) { create(:project_deploy_token, project: project, deploy_token: deploy_token) }
|
|
|
|
|
|
|
|
it { is_expected.to belong_to :project }
|
|
|
|
it { is_expected.to belong_to :deploy_token }
|
|
|
|
|
|
|
|
it { is_expected.to validate_presence_of :deploy_token }
|
|
|
|
it { is_expected.to validate_presence_of :project }
|
|
|
|
it { is_expected.to validate_uniqueness_of(:deploy_token_id).scoped_to(:project_id) }
|
|
|
|
end
|