1
0
Fork 0
This repository has been archived on 2023-03-27. You can view files and clone it, but cannot push or open issues or pull requests.
lpr-partynest/spec/models/role_spec.rb

36 lines
631 B
Ruby
Raw Normal View History

2018-11-29 18:26:48 -05:00
# frozen_string_literal: true
require 'rails_helper'
2018-11-30 02:00:03 -05:00
RSpec.describe Role do
2018-11-29 18:26:48 -05:00
subject { create :role }
2019-02-01 22:48:23 -05:00
it do
is_expected.to \
have_many(:account_roles)
2019-02-01 23:27:42 -05:00
.inverse_of(:role)
2019-02-01 22:48:23 -05:00
.dependent(:restrict_with_exception)
end
it do
is_expected.to \
have_many(:accounts)
.through(:account_roles)
end
2019-02-01 16:01:02 -05:00
describe '#name' do
def allow_value(*)
super.for :name
end
it { is_expected.to validate_presence_of :name }
it { is_expected.not_to allow_value 'foobar' }
it { is_expected.to allow_value 'superuser' }
end
2018-12-05 20:48:13 -05:00
pending '#human_name'
2019-02-01 21:35:58 -05:00
pending '#human_resource'
2018-11-29 18:26:48 -05:00
end