feat: CRUD operation for associated articles to current article (#4912)
This commit is contained in:
@@ -80,6 +80,7 @@ RSpec.describe Article, type: :model do
|
||||
|
||||
params = { query: 'title' }
|
||||
records = portal_1.articles.search(params)
|
||||
|
||||
expect(records.count).to eq(4)
|
||||
|
||||
params = { query: 'the content' }
|
||||
|
||||
8
spec/models/portal_member_spec.rb
Normal file
8
spec/models/portal_member_spec.rb
Normal file
@@ -0,0 +1,8 @@
|
||||
require 'rails_helper'
|
||||
|
||||
RSpec.describe PortalMember, type: :model do
|
||||
describe 'associations' do
|
||||
it { is_expected.to belong_to(:portal) }
|
||||
it { is_expected.to belong_to(:user) }
|
||||
end
|
||||
end
|
||||
@@ -12,5 +12,7 @@ RSpec.describe Portal, type: :model do
|
||||
it { is_expected.to have_many(:categories) }
|
||||
it { is_expected.to have_many(:folders) }
|
||||
it { is_expected.to have_many(:articles) }
|
||||
it { is_expected.to have_many(:portal_members) }
|
||||
it { is_expected.to have_many(:members) }
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user