gitlab-org--gitlab-foss/spec/models/project_deploy_token_spec.rb
Mayra Cabrera 2991381630 Addresses database comments
- Adds a default on expires_at datetime
- Modifies deploy tokens views to handle default expires at value
- Use datetime_with_timezone where possible
- Remove unused scopes
2018-04-06 21:20:17 -05:00

14 lines
570 B
Ruby

require 'rails_helper'
RSpec.describe ProjectDeployToken, type: :model do
let(:project) { create(:project) }
let(:deploy_token) { create(:deploy_token) }
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