Commit adf0c5d6 authored by Samir Noir's avatar Samir Noir 🧀
Browse files

Add users and nodes to collection's links on vlans root

parent e61e96df
Pipeline #185849 waiting for manual action with stages
in 21 minutes and 21 seconds
......@@ -144,6 +144,16 @@ class VlansController < ApplicationController
def links_for_collection
[
{
'rel' => 'nodes',
'href' => uri_to(File.join(collection_path, 'nodes')),
'type' => api_media_type(:g5kcollectionjson)
},
{
'rel' => 'users',
'href' => uri_to(File.join(collection_path, 'users')),
'type' => api_media_type(:g5kcollectionjson)
},
{
'rel' => 'self',
'href' => uri_to(collection_path),
......
......@@ -38,7 +38,7 @@ describe VlansController do
expect(json['total']).to eq(22)
expect(json['offset']).to eq(0)
expect(json['items'].length).to eq(22)
expect(json['links'].length).to eq(2)
expect(json['links'].length).to eq(4)
expect(json['items'].first['uid']).to eq('DEFAULT')
expect(json['items'].map { |i| i['uid'].to_i }.sort).to eq (0..21).to_a.sort
......@@ -72,6 +72,16 @@ describe VlansController do
}
])
expect(json['links']).to eq([
{
'rel' => 'nodes',
'href' => '/sites/rennes/vlans/nodes',
'type' => api_media_type(:g5kcollectionjson)
},
{
'rel' => 'users',
'href' => '/sites/rennes/vlans/users',
'type' => api_media_type(:g5kcollectionjson)
},
{
'rel' => 'self',
'href' => '/sites/rennes/vlans',
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment