No autocompletion in rspec tests when they're in a subdirectory?

This is odd. If I have a test file in spec/models, RM is not able to autocomplete the rspec matchers (have_*, etc). But, if I take this file and move it up a directory and just put it in spec, it works correctly. I don't understand why. I even tried adding the models folder as a test folder in the project settings, but that didn't work. Am I missing something or is this a bug?

RubyMine 2.0.1
Ubuntu
Ruby 1.9.1
Rails 2.3.5

3 comments
Comment actions Permalink

looks a lot like the issue I describe here:

http://www.jetbrains.net/devnet/thread/287750?tstart=0

As soon as you are not in the 'official' folder, RM does not see the files.

0
Comment actions Permalink

Hello Ryan,

Please try RubyMine 2.0.2 rc2.

Does your *_rspec.rb file require "spec_helper"? Probably RM cannot resolve such require when you test is located in spec/models. Could you attach a screenshot how this file looks like in spec/modules folder. As far as I remember such problem was noticed in 2.0.1 and already fixed in 2.0.2. In my RM 2.0.2 rc2 completion works as expected
Screen shot 2010-04-16 at 2.36.17 PM.png

0
Comment actions Permalink

Hey Roman,

I just tried RC2 and it still has the same problem. It seems that spec_helper is getting included properly because I can mouseover it and it shows the correct path (and it isn't squiggly underlined).

Here is a screenshot: i.imgur.com/1oX50.png

0

Please sign in to leave a comment.