File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -152,7 +152,7 @@ def resource_serializer_klass
152152 end
153153
154154 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 } "
156156 end
157157
158158 def resource_klass_name
Original file line number Diff line number Diff line change @@ -10,6 +10,13 @@ def setup
1010 JSONAPI . configuration . always_include_to_one_linkage_data = false
1111 end
1212
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+
1320 def test_index
1421 assert_cacheable_get :index
1522 assert_response :success
You can’t perform that action at this time.
0 commit comments