This repository has been archived on 2023-03-28. You can view files and clone it, but cannot push or open issues or pull requests.
2018-11-30 08:13:54 +00:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
require 'rails_helper'
|
|
|
|
|
|
|
|
RSpec.describe PassportConfirmation do
|
|
|
|
subject { create :passport_confirmation }
|
|
|
|
|
|
|
|
it { is_expected.to belong_to(:passport).required }
|
|
|
|
it { is_expected.to belong_to(:user).required }
|
|
|
|
|
|
|
|
it do
|
|
|
|
is_expected.to validate_uniqueness_of(:user_id).scoped_to(:passport_id)
|
|
|
|
end
|
2018-12-01 11:05:50 +00:00
|
|
|
|
|
|
|
it { is_expected.not_to allow_value(create(:passport)).for :passport }
|
|
|
|
it { is_expected.to allow_value(create(:confirmed_passport)).for :passport }
|
2018-11-30 08:13:54 +00:00
|
|
|
end
|