Relasi optional + RSpec dengan shoulda-matchers
13 Oktober 2020
User 1 - 0..1 Laptop
- Model
a/m/user.rb has\_one :laptop
a/m/laptop.rb belongs_to :user, optional: true
- spec
*ruby
s/m/laptop\_spec.rb
it \{ should belong\_to(:user).optional }*