feat: CRUD operation for associated articles to current article (#4912)

This commit is contained in:
Tejaswini Chile
2022-07-04 20:29:44 +05:30
committed by GitHub
parent 62ed9fe1b4
commit ae59d0a343
28 changed files with 422 additions and 33 deletions

View File

@@ -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' }

View 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

View File

@@ -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