开发者

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

开发者 https://www.devze.com 2023-01-07 15:54 出处:网络
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.

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

精彩评论

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