【发布时间】:2016-09-22 06:28:47
【问题描述】:
我正在编写thinking-Sphinx 测试用例。我有以下测试用例
test 'z' do
app = applications(:one)
message = messages(:two)
message.update_column(:messagable_id, app.id)
message.update_column(:comment, 'This is second message')
ThinkingSphinx::Test.start
sign_in @user
ThinkingSphinx::Test.index
get :index, company_id: @company.id, qc: 'Messages', q: 'Body | second', format: 'json'
assert_response :success
assert_equal decode_json_response(@response)['apps'].count, 2
end
在我的情况下 message.update_column 没有生效,相反,如果我在消息夹具中进行相同的更改,那么我得到了我的测试用例 通过。
update_column 没有影响思考狮身人面像有什么具体原因,因为其他地方 update_column 工作得很好。
【问题讨论】:
-
您是否在测试中使用事务性固定装置?
-
是的,我正在使用跨国灯具
标签: ruby-on-rails thinking-sphinx