开发者

Rails 3.1 Testing AJAX Capybara and Spec

开发者 https://www.devze.com 2023-04-11 01:13 出处:网络
I have a mountable engine that provides Javascript assets to the main Rails App, but while I try testing AJAX calls (provided by the Javascript I just mentioned) in Capybara and Spec. The database doe

I have a mountable engine that provides Javascript assets to the main Rails App, but while I try testing AJAX calls (provided by the Javascript I just mentioned) in Capybara and Spec. The database doesn't seem to update.

Because of the cluster nature of testing, I can't have a clear understanding of what exactly is being run and loaded on the Dummy App. I was thinking about running the Dummy App as a standalone app and verify what is being rendered via the web browser (sort of manually checking things out). But that wasn't possible because of a Gemfile not found error every time I try running 'rails s' within the spec/dummy folder.

So my question: is there another way to check why the AJAX calls are not working in my test cases(although when I run the app normally th开发者_如何学Goe AJAX calls are working just fine) or does anyone know how to run the dummy app as a standalone rails App?

Thanks


The default settings of Capybara doesn't allow AJAX calls.....I had to modify the driver used by Capybara in the spec_helper.rb by adding the following: Capybara.default_driver = :selenium

0

精彩评论

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