@@ -7,6 +7,15 @@ module RubyLsp
7
7
module Rails
8
8
class HoverTest < ActiveSupport ::TestCase
9
9
setup do
10
+ stub_request ( :get , %r{https://api\. rubyonrails\. org/v.*/js/search_index\. js} )
11
+ . with (
12
+ headers : {
13
+ "Host" => "api.rubyonrails.org" ,
14
+ "User-Agent" => "Ruby" ,
15
+ } ,
16
+ )
17
+ . to_return ( status : 200 , body : "{}" , headers : { } )
18
+
10
19
# Build the Rails documents index ahead of time
11
20
capture_io do
12
21
Support ::RailsDocumentClient . send ( :search_index )
@@ -186,17 +195,6 @@ class User < ApplicationRecord
186
195
end
187
196
188
197
test "shows documentation for routes DSLs" do
189
- stub_request ( :get , "https://api.rubyonrails.org/v7.1.3.2/js/search_index.js" )
190
- . with (
191
- headers : {
192
- "Accept" => "*/*" ,
193
- "Accept-Encoding" => "gzip;q=1.0,deflate;q=0.6,identity;q=0.3" ,
194
- "Host" => "api.rubyonrails.org" ,
195
- "User-Agent" => "Ruby" ,
196
- } ,
197
- )
198
- . to_return ( status : 200 , body : "" , headers : { } )
199
-
200
198
value = hover_on_source ( "root 'projects#index'" , { line : 0 , character : 0 } ) . contents . value
201
199
202
200
assert_match ( /\[ Rails Document: `ActionDispatch::Routing::Mapper::Resources#root`\] / , value )
0 commit comments