@@ -1557,7 +1557,7 @@ function! s:Complete_script(ArgLead,CmdLine,P)
15571557 return s: modelList (a: ArgLead ," " ," " )
15581558 elseif target == # ' migration' || target == # ' session_migration'
15591559 return s: migrationList (a: ArgLead ," " ," " )
1560- elseif target == # ' integration_test' || target == # ' feature'
1560+ elseif target == # ' integration_test' || target == # ' integration_spec ' || target == # ' feature'
15611561 return s: integrationtestList (a: ArgLead ," " ," " )
15621562 elseif target == # ' observer'
15631563 let observers = s: observerList (" " ," " ," " )
@@ -2032,7 +2032,7 @@ function! s:BufFinderCommands()
20322032 call s: addfilecmds (" unittest" )
20332033 call s: addfilecmds (" functionaltest" )
20342034 endif
2035- if rails#app ().has (' test' ) || rails#app ().has (' cucumber' )
2035+ if rails#app ().has (' test' ) || rails#app ().has (' spec ' ) || rails#app (). has ( ' cucumber' )
20362036 call s: addfilecmds (" integrationtest" )
20372037 endif
20382038 if rails#app ().has (' spec' )
@@ -2187,14 +2187,20 @@ function! s:functionaltestList(A,L,P)
21872187endfunction
21882188
21892189function ! s: integrationtestList (A,L,P )
2190+ if a: A = ~# ' ^\u'
2191+ return s: autocamelize (rails#app ().relglob (" test/integration/" ," **/*" ," _test.rb" ),a: A )
2192+ endif
21902193 let found = []
21912194 if rails#app ().has (' test' )
2192- let found += s: autocamelize (rails#app ().relglob (" test/integration/" ," **/*" ," _test.rb" ),a: A )
2195+ let found += rails#app ().relglob (" test/integration/" ," **/*" ," _test.rb" )
2196+ endif
2197+ if rails#app ().has (' spec' )
2198+ let found += rails#app ().relglob (" spec/integration/" ," **/*" ," _spec.rb" )
21932199 endif
21942200 if rails#app ().has (' cucumber' )
2195- let found += s: completion_filter ( rails#app ().relglob (" features/" ," **/*" ," .feature" ), a: A )
2201+ let found += rails#app ().relglob (" features/" ," **/*" ," .feature" )
21962202 endif
2197- return found
2203+ return s: completion_filter ( found, a: A )
21982204endfunction
21992205
22002206function ! s: specList (A,L,P )
@@ -2609,11 +2615,7 @@ endfunction
26092615
26102616function ! s: integrationtestEdit (cmd,... )
26112617 if ! a: 0
2612- if rails#app ().has (' cucumber' ) && ! rails#app ().has (' test' )
2613- return s: EditSimpleRb (a: cmd ," integrationtest" ," support/env" ," features/" ," .rb" )
2614- else
2615- return s: EditSimpleRb (a: cmd ," integrationtest" ," test_helper" ," test/" ," .rb" )
2616- endif
2618+ return s: EditSimpleRb (a: cmd ," integrationtest" ," test/test_helper\n features/support/env\n spec/spec_helper" ," " ," .rb" )
26172619 endif
26182620 let f = rails#underscore (matchstr (a: 1 ,' [^!#:]*' ))
26192621 let jump = matchstr (a: 1 ,' [!#:].*' )
@@ -2622,7 +2624,7 @@ function! s:integrationtestEdit(cmd,...)
26222624 else
26232625 let cmd = s: findcmdfor (a: cmd )
26242626 endif
2625- let mapping = {' test' : [' test/integration/' ,' _test.rb' ], ' cucumber' : [' features/' ,' .feature' ]}
2627+ let mapping = {' test' : [' test/integration/' ,' _test.rb' ], ' spec ' : [ ' spec/integration/ ' , ' _spec.rb ' ], ' cucumber' : [' features/' ,' .feature' ]}
26262628 let tests = map (filter (rails#app ().test_suites (),' has_key(mapping,v:val)' ),' get(mapping,v:val)' )
26272629 if empty (tests)
26282630 let tests = [mapping [' test' ]]
0 commit comments