File tree Expand file tree Collapse file tree 2 files changed +8
-1
lines changed Expand file tree Collapse file tree 2 files changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -152,7 +152,7 @@ def resource_serializer_klass
152
152
end
153
153
154
154
def base_url
155
- @base_url ||= request . protocol + request . host_with_port
155
+ @base_url ||= " #{ request . protocol } #{ request . host_with_port } #{ Rails . application . config . relative_url_root } "
156
156
end
157
157
158
158
def resource_klass_name
Original file line number Diff line number Diff line change @@ -10,6 +10,13 @@ def setup
10
10
JSONAPI . configuration . always_include_to_one_linkage_data = false
11
11
end
12
12
13
+ def test_links_include_relative_root
14
+ Rails . application . config . relative_url_root = '/subdir'
15
+ assert_cacheable_get :index
16
+ assert json_response [ 'data' ] [ 0 ] [ 'links' ] [ 'self' ] . include? ( '/subdir' )
17
+ Rails . application . config . relative_url_root = nil
18
+ end
19
+
13
20
def test_index
14
21
assert_cacheable_get :index
15
22
assert_response :success
You can’t perform that action at this time.
0 commit comments