Add translations to budget investments pg_search_scope
Some Budget::Investment attributes are now translatable so we need to include all existing translations on pg_search model scope.
This commit is contained in:
committed by
voodoorai2000
parent
9a459070e9
commit
e8f53cb8b7
@@ -683,12 +683,23 @@ describe Budget::Investment do
|
||||
|
||||
context "attributes" do
|
||||
|
||||
let(:attributes) { { title: "save the world",
|
||||
description: "in order to save the world one must think about...",
|
||||
title_es: "para salvar el mundo uno debe pensar en...",
|
||||
description_es: "uno debe pensar" } }
|
||||
|
||||
it "searches by title" do
|
||||
budget_investment = create(:budget_investment, title: "save the world")
|
||||
budget_investment = create(:budget_investment, attributes)
|
||||
results = described_class.search("save the world")
|
||||
expect(results).to eq([budget_investment])
|
||||
end
|
||||
|
||||
it "searches by title across all languages" do
|
||||
budget_investment = create(:budget_investment, attributes)
|
||||
results = described_class.search("salvar el mundo")
|
||||
expect(results).to eq([budget_investment])
|
||||
end
|
||||
|
||||
it "searches by author name" do
|
||||
author = create(:user, username: "Danny Trejo")
|
||||
budget_investment = create(:budget_investment, author: author)
|
||||
|
||||
Reference in New Issue
Block a user