Commit 2e5ee014 authored by MARGERY David's avatar MARGERY David Committed by Florent Didier
Browse files

Applies cosmetic changes to limit diff

This is to reduce diff to lnussbaum/jessie-rebased
(e698119d6dd76ba5b9c30336c69f58bc85e3ec8a) as much a possible
to understand more precisely the differences between the v3 branch and
the development branch
parent ea49c95c
......@@ -14,7 +14,8 @@
require 'resources_controller'
# This ServersController taken from jessie branch for bug ref. 7464 -- 2016.10.27
# This initial ServersController prepared in response to bug ref. 7301 -- 2016.10.24
# To be decorated later as features develop for /servers
class ServersController < ResourcesController
protected
......
......@@ -42,7 +42,7 @@ Api::Application.routes.draw do
end
resources :nodes, :only => [:index, :show]
end
# abasu bug #7464 to incorporate feature /servers -- 2016.10.27
# abasu bug #7301 to incorporate feature /servers -- 2016.10.24
resources :servers, :only => [:index, :show]
resources :jobs
resources :deployments
......
......@@ -17,7 +17,7 @@ require 'spec_helper'
describe ServersController do
render_views
# abasu : unit test for bug ref 7464 to handle /servers - 27.10.2016
# abasu : unit test for bug ref 7301 to handle /servers - 24.10.2016
describe "GET /sites/{{site_id}}/servers/{{id}}" do
# The following unit tests check the responses at level of specific servers.
......@@ -32,11 +32,11 @@ describe ServersController do
# abasu : unit tests for bug ref 7464 to handle /servers - 27.10.2016
# abasu : unit tests for bug ref 7301 to handle /servers - 24.10.2016
describe "GET /sites/{{site_id}}/servers" do
# The following unit tests check the responses at level of all servers in a site
# abasu : unit test for bug ref 7464 to handle /servers - 27.10.2016
# abasu : unit test for bug ref 7301 to handle /servers - 24.10.2016
it "should return 2 servers in site nancy and their exact names" do
get :index, :branch => 'master', :site_id => "nancy", :format => :json
assert_media_type(:json)
......
......@@ -105,6 +105,16 @@ describe SitesController do
]
end
# abasu 19.10.2016 - bug #7364 changed "deployments" to "deployment"
it "should return link for deployment" do
get :show, :id => "rennes", :format => :json
response.status.should == 200
json['uid'].should == 'rennes'
json['links'].find{|l|
l['rel'] == 'deployment'
}['href'].should == "/sites/rennes/deployment"
end # it "should return link for deployment" do
# abasu 26.10.2016 - bug #7301 should return link /servers if present in site
it "should return link /servers if present in site" do
get :show, :id => "nancy", :format => :json
......@@ -113,8 +123,8 @@ describe SitesController do
json['links'].find{|l|
l['rel'] == 'servers'
}['href'].should == "/sites/nancy/servers"
end # it "should return link for servers" do
end # it "should return link /servers if present in site" do
it "should return the specified version, and the max-age value in the Cache-Control header should be big" do
get :show, :id => "rennes", :format => :json, :version => "b00bd30bf69c322ffe9aca7a9f6e3be0f29e20f4"
response.status.should == 200
......
......@@ -193,6 +193,7 @@ describe Grid5000::Repository do
describe "versions_for" do
it "find the versions for a resource" do
# abasu - 24.10.2016 - update "total" value from 8 to 10
@repository.versions_for("grid5000/sites")["total"].should == 10
end
it "should return an empty list if the resource does not exist" do
......
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