debian-mirror-gitlab/spec/models/user_detail_spec.rb

30 lines
978 B
Ruby
Raw Normal View History

2020-04-08 14:13:33 +05:30
# frozen_string_literal: true
require 'spec_helper'
2020-07-28 23:09:34 +05:30
RSpec.describe UserDetail do
2020-04-08 14:13:33 +05:30
it { is_expected.to belong_to(:user) }
2021-11-18 22:05:49 +05:30
it { is_expected.to define_enum_for(:registration_objective).with_values([:basics, :move_repository, :code_storage, :exploring, :ci, :other, :joining_team]).with_suffix }
2020-04-08 14:13:33 +05:30
describe 'validations' do
2020-07-28 23:09:34 +05:30
describe '#job_title' do
2020-04-08 14:13:33 +05:30
it { is_expected.not_to validate_presence_of(:job_title) }
it { is_expected.to validate_length_of(:job_title).is_at_most(200) }
end
2020-07-28 23:09:34 +05:30
2021-09-04 01:27:46 +05:30
describe '#pronouns' do
it { is_expected.not_to validate_presence_of(:pronouns) }
it { is_expected.to validate_length_of(:pronouns).is_at_most(50) }
end
2021-10-27 15:23:28 +05:30
describe '#pronunciation' do
it { is_expected.not_to validate_presence_of(:pronunciation) }
it { is_expected.to validate_length_of(:pronunciation).is_at_most(255) }
end
2020-07-28 23:09:34 +05:30
describe '#bio' do
it { is_expected.to validate_length_of(:bio).is_at_most(255) }
end
end
2020-04-08 14:13:33 +05:30
end