feat: Added portal logo and the updated the JSON (#4996)

This commit is contained in:
Tejaswini Chile
2022-07-11 12:43:24 +05:30
committed by GitHub
parent 9d4b77533e
commit 23ac1c0334
10 changed files with 101 additions and 11 deletions

View File

@@ -15,11 +15,24 @@ RSpec.describe Category, type: :model do
it { is_expected.to have_many(:related_categories) }
end
describe 'validations' do
let!(:account) { create(:account) }
let(:user) { create(:user, account_ids: [account.id], role: :agent) }
let!(:portal) { create(:portal, account_id: account.id, config: { allowed_locales: ['en'] }) }
it 'returns erros when locale is not allowed in the portal' do
category = create(:category, slug: 'category_1', locale: 'en', portal_id: portal.id)
expect(category).to be_valid
category.update(locale: 'es')
expect(category.errors.full_messages[0]).to eq("Locale es of category is not part of portal's [\"en\"].")
end
end
describe 'search' do
let!(:account) { create(:account) }
let(:user) { create(:user, account_ids: [account.id], role: :agent) }
let!(:portal_1) { create(:portal, account_id: account.id) }
let!(:portal_2) { create(:portal, account_id: account.id) }
let!(:portal_1) { create(:portal, account_id: account.id, config: { allowed_locales: %w[en es] }) }
let!(:portal_2) { create(:portal, account_id: account.id, config: { allowed_locales: %w[en es] }) }
before do
create(:category, slug: 'category_1', locale: 'en', portal_id: portal_1.id)