我想测试我的搜索方法,但如何测试to_indexed_json
结果。
这是我的测试:
describe Search do
before do
Question.index.delete
Question.tire.create_elasticsearch_index
app = create :app, name: "Marketing", id: 76
@question1 = create :question, content: "Some super question?", app: app
@question2 = create :question, content: "Some extra question?", app: app
end
describe "#results" do
it "returns matched results" do
Search.new("Some", \[76\]).results.should == \[@question1, @question2\]
end
end
end
这是我收到的错误: