debian-mirror-gitlab/spec/models/error_tracking/client_key_spec.rb

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

20 lines
516 B
Ruby
Raw Normal View History

2021-10-27 15:23:28 +05:30
# frozen_string_literal: true
require 'spec_helper'
RSpec.describe ErrorTracking::ClientKey, type: :model do
describe 'relationships' do
it { is_expected.to belong_to(:project) }
end
describe 'validations' do
it { is_expected.to validate_presence_of(:public_key) }
it { is_expected.to validate_length_of(:public_key).is_at_most(255) }
end
describe '#generate_key' do
it { expect(subject.public_key).to be_present }
it { expect(subject.public_key).to start_with('glet_') }
end
end