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

41 lines
741 B
Ruby
Raw Normal View History

2018-11-30 04:26:48 +05:00
# frozen_string_literal: true
require 'rails_helper'
2018-11-30 12:00:03 +05:00
RSpec.describe Role do
2018-11-30 04:26:48 +05:00
subject { create :role }
2019-07-20 15:14:08 +05:00
pending '.make!'
pending '#human_name'
pending '#human_resource'
2019-02-02 08:48:23 +05:00
2019-07-20 15:14:08 +05:00
describe '#account_roles' do
it do
is_expected.to \
have_many(:account_roles)
.inverse_of(:role)
.dependent(:restrict_with_exception)
end
2019-02-02 08:48:23 +05:00
end
2019-07-20 15:14:08 +05:00
describe '#accounts' do
it do
is_expected.to \
have_many(:accounts)
.through(:account_roles)
end
end
2019-02-08 12:32:33 +05:00
2019-02-02 02: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-11-30 04:26:48 +05:00
end