@@ -2254,6 +2254,7 @@ function! s:functionaltestList(A,L,P)
2254
2254
endif
2255
2255
if rails#app ().has (' spec' )
2256
2256
let found += rails#app ().relglob (" spec/controllers/" ," **/*" ," _spec.rb" )
2257
+ let found += rails#app ().relglob (" spec/mailers/" ," **/*" ," _spec.rb" )
2257
2258
endif
2258
2259
return s: autocamelize (found,a: A )
2259
2260
endfunction
@@ -2657,21 +2658,21 @@ function! s:functionaltestEdit(cmd,...)
2657
2658
else
2658
2659
let cmd = s: findcmdfor (a: cmd )
2659
2660
endif
2660
- let mapping = {' test' : [' test/functional/' , ' _test.rb' ] , ' spec' : [' spec/controllers/' ,' _spec.rb' ]}
2661
+ let mapping = {' test' : [[ ' test/functional/' ],[ ' _test.rb' , ' _controller_test.rb ' ]] , ' spec' : [[ ' spec/controllers/' ,' spec/mailers/ ' ],[ ' _spec.rb' , ' _controller_spec.rb ' ] ]}
2661
2662
let tests = map (filter (rails#app ().test_suites (),' has_key(mapping,v:val)' ),' get(mapping,v:val)' )
2662
2663
if empty (tests)
2663
2664
let tests = [mapping [tests]]
2664
2665
endif
2665
- for [prefix, suffix ] in tests
2666
- if rails#app (). has_file ( prefix. f .suffix)
2667
- return s: findedit (cmd,prefix. f . suffix.jump)
2668
- elseif rails#app ().has_file (prefix.f . ' _controller ' .suffix)
2669
- return s: findedit (cmd,prefix.f . ' _controller ' .suffix.jump)
2670
- elseif rails#app (). has_file (prefix. f . ' _api ' .suffix)
2671
- return s: findedit (cmd,prefix. f . ' _api ' .suffix.jump)
2672
- endif
2666
+ for [prefixes, suffixes ] in tests
2667
+ for prefix in prefixes
2668
+ for suffix in suffixes
2669
+ if rails#app ().has_file (prefix.f .suffix)
2670
+ return s: findedit (cmd,prefix.f .suffix.jump)
2671
+ endif
2672
+ endfor
2673
+ endfor
2673
2674
endfor
2674
- return s: EditSimpleRb (a: cmd ," functionaltest" ,f .jump,tests[0 ][0 ],tests[0 ][1 ],1 )
2675
+ return s: EditSimpleRb (a: cmd ," functionaltest" ,f .jump,tests[0 ][0 ][ 0 ] ,tests[0 ][1 ][ 0 ],1 )
2675
2676
endfunction
2676
2677
2677
2678
function ! s: integrationtestEdit (cmd,... )
0 commit comments