Capybara code completion in RubyMine

Is there a way to get some help from RubyMine code completion when using the Capybara definition in Cucumber? I'm new to Capybara, so not necessarily checking the link site all the time would be very helpful.

The best I can get at the moment is to explicitly call Session.new , something like:

 session = Capybara::Session.new(:rack_test, my_app) 

This method is Ctrl+Space after session. shows me the methods from Capybara :: Session (only), so at least I know it is somehow accessible. But this is not how I really use Capybara in my step definitions. I thought that helping the type-input engine manually by annotating the page might do the trick, but I suppose all this DSL magic is too much to handle.

So, in principle, is it possible

 page.<Ctrl+Space> 

pops up with all open DSL methods? RubyMine API maybe? Or, as an alternative, in some other way approximate referenced documents (I don't think RubyMine still supports external documents in the IDE)?

+6
rubymine cucumber capybara
source share
1 answer

As of RubyMine 8.0.3, no answer has been specified; RubyMine does not execute the Capybara methods following the page. in the definitions of cucumbers, at least not when Capybara is included in the cucumber through the pearls of cucumbers. I do not see the function request in the RubyMine tray log ; someone can add one if he wants.

Note that perch rails at least include the Capybara DSL in the world of cucumbers, so you don't need to enter a page. before Capybara methods. You can just call visit , fill_in , etc. Like your own methods. I would not want an unnecessary page. in my step definitions just for the sake of completing RubyMine.

Unfortunately, RubyMine also does not include Capybara's methods in the list of names that it terminates when you call completion in the definition of a step before entering anything. It includes the Capybara methods in the list of names that it terminates when you call termination twice (all names in all available code), but since this list is so long, it is only useful if you already know the method you want, or at least the correct prefix.

0
source share

All Articles