feat(v4): Update the help center portal design (#10296)
Co-authored-by: Pranav <pranavrajs@gmail.com>
This commit is contained in:
@@ -68,6 +68,13 @@ RSpec.describe 'Public Articles API', type: :request do
|
||||
expect(article.reload.views).to eq 1
|
||||
end
|
||||
|
||||
it 'does not increment the view count if the article is not published' do
|
||||
draft_article = create(:article, category: category, status: :draft, portal: portal, account_id: account.id, author_id: agent.id, views: 0)
|
||||
get "/hc/#{portal.slug}/articles/#{draft_article.slug}"
|
||||
expect(response).to have_http_status(:success)
|
||||
expect(draft_article.reload.views).to eq 0
|
||||
end
|
||||
|
||||
it 'returns the article with the id with a different locale' do
|
||||
article_in_locale = create(:article, category: category_2, portal: portal, account_id: account.id, author_id: agent.id)
|
||||
get "/hc/#{portal.slug}/articles/#{article_in_locale.slug}"
|
||||
|
||||
@@ -54,7 +54,7 @@ RSpec.describe Article do
|
||||
it 'adds locale to article from portal' do
|
||||
article = create(:article, content: 'This is the content', description: 'this is the description',
|
||||
slug: 'this-is-title', title: 'this is title',
|
||||
portal_id: portal.id, author_id: user.id)
|
||||
portal_id: portal.id, author_id: user.id, locale: '')
|
||||
expect(article.locale).to eq(portal.default_locale)
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user