feat: Category API to handle linked categories and parent-sub categories (#4879)

This commit is contained in:
Tejaswini Chile
2022-06-28 11:23:20 +05:30
committed by GitHub
parent c0249a1b5b
commit df1bf112ea
15 changed files with 286 additions and 29 deletions

View File

@@ -9,8 +9,10 @@ RSpec.describe Category, type: :model do
describe 'associations' do
it { is_expected.to belong_to(:account) }
it { is_expected.to belong_to(:portal) }
it { is_expected.to have_many(:folders) }
it { is_expected.to have_many(:articles) }
it { is_expected.to have_many(:sub_categories) }
it { is_expected.to have_many(:linked_categories) }
it { is_expected.to have_many(:related_categories) }
end
describe 'search' do

View File

@@ -0,0 +1,8 @@
require 'rails_helper'
RSpec.describe RelatedCategory, type: :model do
describe 'associations' do
it { is_expected.to belong_to(:category) }
it { is_expected.to belong_to(:related_category) }
end
end