开发者

How should we test an rjs response in Rails Functional tests?

How can I test a .js.rjs respo开发者_如何学Gonse in rails(2.3.8) functional test ?


You can take the simple path and verify the contents being returned seem correct with a functional test.

However, you'll probably get a lot more value from something like Capybara and Celerity that will let you do real integration testing with a live JavaScript engine and verify the RJS causes the page behave you expect.

http://github.com/jnicklas/capybara/blob/master/README.rdoc


There's assert_select_rjs in case you weren't aware of it (like I was). Its something like an assert_tag for RJS output.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜