Add search method to polls
So far the method does not take questions nor answers into account. This way we'll be able to search polls in the SDG Management section.
This commit is contained in:
@@ -32,3 +32,22 @@ describe "rake db:load_sdg" do
|
||||
expect(SDG::Target.last.id).to eq target_id
|
||||
end
|
||||
end
|
||||
|
||||
describe "rake db:calculate_tsv" do
|
||||
before { Rake::Task["db:calculate_tsv"].reenable }
|
||||
|
||||
let :run_rake_task do
|
||||
Rake.application.invoke_task("db:calculate_tsv")
|
||||
end
|
||||
|
||||
it "calculates the tsvector for polls" do
|
||||
poll = create(:poll)
|
||||
poll.update_column(:tsv, nil)
|
||||
|
||||
expect(poll.reload.tsv).to be nil
|
||||
|
||||
run_rake_task
|
||||
|
||||
expect(poll.reload.tsv).not_to be nil
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user