Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Performance fixes for the object creation stuff.

Removed the schema from the content-type. Need to work out
a more standard way for version communication.

Change-Id: Ic8bc1a69ba57b6793096425947cc9fdeedaf99fc
  • Loading branch information...
commit a22e8e86d805936dc93265e7ee843771bbbca094 1 parent 24baa1c
@joeldsa joeldsa authored
View
4 lib/acm/api_controller.rb
@@ -53,7 +53,7 @@ def initialize
# Main error handler for the ACM
error do
- content_type 'application/json', :charset => 'utf-8', :schema => ACM::Config.default_schema_version
+ content_type 'application/json', :charset => 'utf-8'
exception = request.env["sinatra.error"]
@logger.debug("Reached error handler #{exception.inspect}")
@@ -77,7 +77,7 @@ def initialize
# not_found sinatra handler for the ACM. Handles routes that cannot
# be found and avoids the standard sinatra response
not_found do
- content_type 'application/json', :charset => 'utf-8', :schema => ACM::Config.default_schema_version
+ content_type 'application/json', :charset => 'utf-8'
@logger.debug("Reached not_found handler")
status(404)
View
2  lib/acm/config.rb
@@ -53,7 +53,7 @@ def configure(config)
VCAP::Logging.setup_from_config(config["logging"])
@logger = VCAP::Logging.logger("acm")
- @log_level = VCAP::Logging.default_log_level
+ @log_level = config["logging"]["level"].to_sym
Dir.chdir(File.expand_path("..", __FILE__))
@revision = `(git show-ref --head --hash=8 2> /dev/null || echo 00000000) | head -n1`.strip
View
1  lib/acm/models/objects.rb
@@ -40,7 +40,6 @@ def set_immutable_id
def to_json
begin
-
@logger.debug("Object Id #{self.id}")
#Get the names out of the permission sets
object_types = (self.permission_sets.nil? || self.permission_sets.size == 0) ?
View
2  lib/acm/routes/access_controller.rb
@@ -17,7 +17,7 @@ class ApiController < Sinatra::Base
get '/objects/:object_id/access/?' do
#params ?id=1234&p=read_appspace,write_appspace
- content_type 'application/json', :charset => 'utf-8', :schema => ACM::Config.default_schema_version
+ content_type 'application/json', :charset => 'utf-8'
object_id = params[:object_id]
if params[:id].nil? || params[:p].nil?
View
12 lib/acm/routes/group_controller.rb
@@ -16,19 +16,19 @@ module ACM::Controller
class ApiController < Sinatra::Base
get '/groups/:group_id' do
- content_type 'application/json', :charset => 'utf-8', :schema => ACM::Config.default_schema_version
+ content_type 'application/json', :charset => 'utf-8'
@group_service.find_group(params[:group_id])
end
delete '/groups/:group_id' do
- content_type 'application/json', :charset => 'utf-8', :schema => ACM::Config.default_schema_version
+ content_type 'application/json', :charset => 'utf-8'
@group_service.delete_group(params[:group_id])
end
post '/groups/:group_id' do
- content_type 'application/json', :charset => 'utf-8', :schema => ACM::Config.default_schema_version
+ content_type 'application/json', :charset => 'utf-8'
request_json = nil
begin
@@ -69,7 +69,7 @@ class ApiController < Sinatra::Base
end
put '/groups/:group_id' do
- content_type 'application/json', :charset => 'utf-8', :schema => ACM::Config.default_schema_version
+ content_type 'application/json', :charset => 'utf-8'
request_json = nil
begin
@@ -106,7 +106,7 @@ class ApiController < Sinatra::Base
end
put '/groups/:group_id/members/:user_id' do
- content_type 'application/json', :charset => 'utf-8', :schema => ACM::Config.default_schema_version
+ content_type 'application/json', :charset => 'utf-8'
updated_group = @group_service.add_user_to_group(params[:group_id], params[:user_id])
@@ -118,7 +118,7 @@ class ApiController < Sinatra::Base
end
delete '/groups/:group_id/members/:user_id' do
- content_type 'application/json', :charset => 'utf-8', :schema => ACM::Config.default_schema_version
+ content_type 'application/json', :charset => 'utf-8'
updated_group = @group_service.remove_user_from_group(params[:group_id], params[:user_id])
View
14 lib/acm/routes/object_controller.rb
@@ -17,25 +17,25 @@ module ACM::Controller
class ApiController < Sinatra::Base
get '/objects/:object_id' do
- content_type 'application/json', :charset => 'utf-8', :schema => ACM::Config.default_schema_version
+ content_type 'application/json', :charset => 'utf-8'
@object_service.read_object(params[:object_id])
end
get '/objects/:object_id/users' do
- content_type 'application/json', :charset => 'utf-8', :schema => ACM::Config.default_schema_version
+ content_type 'application/json', :charset => 'utf-8'
@object_service.get_users_for_object(params[:object_id])
end
delete '/objects/:object_id' do
- content_type 'application/json', :charset => 'utf-8', :schema => ACM::Config.default_schema_version
+ content_type 'application/json', :charset => 'utf-8'
@object_service.delete_object(params[:object_id])
end
post '/objects' do
- content_type 'application/json', :charset => 'utf-8', :schema => ACM::Config.default_schema_version
+ content_type 'application/json', :charset => 'utf-8'
request_json = nil
begin
@@ -74,7 +74,7 @@ class ApiController < Sinatra::Base
end
put '/objects/:object_id' do
- content_type 'application/json', :charset => 'utf-8', :schema => ACM::Config.default_schema_version
+ content_type 'application/json', :charset => 'utf-8'
if params[:object_id].nil?
@logger.error("Empty object id")
@@ -124,7 +124,7 @@ class ApiController < Sinatra::Base
#Add permission(s) for a subject to an object's acl
put '/objects/:object_id/acl' do
# PUT /objects/*object_id*/acl?id=*subject*&p=*permission1*,*permission2*
- content_type 'application/json', :charset => 'utf-8', :schema => ACM::Config.default_schema_version
+ content_type 'application/json', :charset => 'utf-8'
permissions_request = params[:p].split(',')
@logger.debug("Permissions requested #{permissions_request.inspect}")
@@ -143,7 +143,7 @@ class ApiController < Sinatra::Base
#Remove permissions for a subject from an object's acl
delete '/objects/:object_id/acl' do
# DELETE /objects/*object_id*/acl?id=*subject*&p=*permission1*,*permission2*
- content_type 'application/json', :charset => 'utf-8', :schema => ACM::Config.default_schema_version
+ content_type 'application/json', :charset => 'utf-8'
permissions_request = params[:p].split(',')
@logger.debug("Permissions requested to be removed are #{permissions_request.inspect}")
View
8 lib/acm/routes/permission_set_controller.rb
@@ -16,13 +16,13 @@ module ACM::Controller
class ApiController < Sinatra::Base
get '/permission_sets/:name' do
- content_type 'application/json', :charset => 'utf-8', :schema => ACM::Config.default_schema_version
+ content_type 'application/json', :charset => 'utf-8'
@permission_set_service.read_permission_set(params[:name])
end
post '/permission_sets' do
- content_type 'application/json', :charset => 'utf-8', :schema => ACM::Config.default_schema_version
+ content_type 'application/json', :charset => 'utf-8'
request_json = nil
begin
@@ -64,7 +64,7 @@ class ApiController < Sinatra::Base
end
put '/permission_sets/:name' do
- content_type 'application/json', :charset => 'utf-8', :schema => ACM::Config.default_schema_version
+ content_type 'application/json', :charset => 'utf-8'
request_json = nil
begin
@@ -100,7 +100,7 @@ class ApiController < Sinatra::Base
end
delete '/permission_sets/:name' do
- content_type 'application/json', :charset => 'utf-8', :schema => ACM::Config.default_schema_version
+ content_type 'application/json', :charset => 'utf-8'
@permission_set_service.delete_permission_set(params[:name])
end
View
6 lib/acm/routes/user_controller.rb
@@ -16,19 +16,19 @@ module ACM::Controller
class ApiController < Sinatra::Base
post '/users/:user_id' do
- content_type 'application/json', :charset => 'utf-8', :schema => ACM::Config.default_schema_version
+ content_type 'application/json', :charset => 'utf-8'
@user_service.create_user(:id => params[:user_id])
end
get '/users/:user_id' do
- content_type 'application/json', :charset => 'utf-8', :schema => ACM::Config.default_schema_version
+ content_type 'application/json', :charset => 'utf-8'
@user_service.get_user_info(params[:user_id])
end
delete '/users/:user_id' do
- content_type 'application/json', :charset => 'utf-8', :schema => ACM::Config.default_schema_version
+ content_type 'application/json', :charset => 'utf-8'
@user_service.delete_user(params[:user_id])
end
View
137 lib/acm/services/object_service.rb
@@ -66,12 +66,41 @@ def create_object(opts = {})
unless acl.nil?
#ACLs are a list of hashes
acl.each { |permission, user_id_set|
+
+ #Find the requested permission only if it belongs to a permission set that is related to that object
+ requested_permission = ACM::Models::Permissions.join(:permission_sets, :id => :permission_set_id)
+ .join(:object_permission_set_map, :permission_set_id => :id)
+ .filter(:object_permission_set_map__object_id => o.id)
+ .filter(:permissions__name => permission.to_s)
+ .select(:permissions__id, :permissions__name)
+ .first()
+ @logger.debug("requested permission #{requested_permission.inspect}")
+
+ if requested_permission.nil?
+ @logger.error("Could not find requested permission #{permission}")
+ raise ACM::InvalidRequest.new("Could not find requested permission #{permission}")
+ end
+
if user_id_set.kind_of?(Array)
user_id_set.each { |user_id|
begin
- subject = get_subject(user_id)
- #TODO: icky code. should allow a set of permissions to be accepted... later
- add_permission(o.immutable_id, permission, subject[:id])
+ subject = find_subject(user_id)
+
+ #find the ace for that object and permission
+ object_aces = o.access_control_entries.select{|ace| ace.permission_id == requested_permission.id && ace.subject_id == subject.id}
+ ace = nil
+ if object_aces.size() == 0
+ ace = o.add_access_control_entry(:object_id => o.id,
+ :permission_id => requested_permission.id,
+ :subject_id => subject.id)
+ @logger.debug("new ace #{ace.inspect}")
+ else
+ ace = object_aces[0]
+ @logger.debug("found ace #{ace.inspect}")
+ end
+
+ @logger.debug("ace count object #{o.id} are #{ACM::Models::AccessControlEntries.filter(:object_id => o.id).count().inspect}") if ACM::Config.log_level == :debug
+
rescue => e
@logger.error("Failed to add permission #{permission.inspect} on object #{o.immutable_id} for user #{user_id} #{e.message} #{e.backtrace}")
raise ACM::InvalidRequest.new("Failed to add permission #{permission} on object #{o.immutable_id} for user #{user_id}")
@@ -157,13 +186,43 @@ def update_object(opts = {})
unless acl.nil?
#ACLs are a list of hashes
acl.each { |permission, user_id_set|
+
+ #Find the requested permission only if it belongs to a permission set that is related to that object
+ requested_permission = ACM::Models::Permissions.join(:permission_sets, :id => :permission_set_id)
+ .join(:object_permission_set_map, :permission_set_id => :id)
+ .filter(:object_permission_set_map__object_id => object.id)
+ .filter(:permissions__name => permission.to_s)
+ .select(:permissions__id, :permissions__name)
+ .first()
+ @logger.debug("requested permission #{requested_permission.inspect}")
+
+ if requested_permission.nil?
+ @logger.error("Could not find requested permission #{permission}")
+ raise ACM::InvalidRequest.new("Could not find requested permission #{permission}")
+ end
+
if user_id_set.kind_of?(Array)
user_id_set.each { |user_id|
begin
- subject = get_subject(user_id)
- add_permission(object.immutable_id, permission, subject[:id])
+ subject = find_subject(user_id)
+
+ #find the ace for that object and permission
+ object_aces = object.access_control_entries.select{|ace| ace.permission_id == requested_permission.id && ace.subject_id == subject.id}
+ ace = nil
+ if object_aces.size() == 0
+ ace = object.add_access_control_entry(:object_id => object.id,
+ :permission_id => requested_permission.id,
+ :subject_id => subject.id)
+ @logger.debug("new ace #{ace.inspect}")
+ else
+ ace = object_aces[0]
+ @logger.debug("found ace #{ace.inspect}")
+ end
+
+ @logger.debug("ace count object #{object.id} are #{ACM::Models::AccessControlEntries.filter(:object_id => object.id).count().inspect}") if ACM::Config.log_level == :debug
+
rescue => e
- @logger.error("Failed to add permission #{permission.inspect} on object #{object.immutable_id} for user #{user_id}")
+ @logger.error("Failed to add permission #{permission.inspect} on object #{object.immutable_id} for user #{user_id} #{e.message} #{e.backtrace}")
raise ACM::InvalidRequest.new("Failed to add permission #{permission} on object #{object.immutable_id} for user #{user_id}")
end
}
@@ -193,46 +252,38 @@ def update_object(opts = {})
object.to_json
end
- def get_subject(subject_id)
- subject = nil
+ def find_subject(subject_id)
+ begin
+ if subject_id.index("g-") == 0
+ group_id = subject_id.sub(/(g-)/, '')
+ group = ACM::Models::Subjects.filter(:immutable_id => group_id, :type => :group.to_s).first()
- if subject_id.index("g-") == 0
- #search for the group. If the group does not exist, error out
- group_id = subject_id.sub(/(g-)/, '')
- group_json = nil
- begin
- group_json = @group_service.find_group(group_id)
- rescue => e
- if e.kind_of?(ACM::ObjectNotFound)
- @logger.error("Could not find group #{group_id} #{e.message}")
- raise e
- else
- @logger.error("Internal error #{e.message}")
- raise ACM::SystemInternalError.new()
+ if group.nil?
+ @logger.error("Could not find group with id #{group_id.inspect}")
+ raise ACM::ObjectNotFound.new("#{subject_id.inspect}")
end
- end
- subject = Yajl::Parser.parse(group_json, :symbolize_keys => true)
- else
- #search for the user. if the user does not exist create it
- user_json = nil
- begin
- user_json = @user_service.find_user(subject_id)
- rescue => e
- if e.kind_of?(ACM::ObjectNotFound)
- @logger.error("Could not find user #{subject_id}.")
- raise e
- else
- @logger.error("Internal error #{e.message}")
- raise ACM::SystemInternalError.new()
+ @logger.debug("Found group #{group.inspect}")
+ group
+ else
+ user = ACM::Models::Subjects.filter(:immutable_id => subject_id, :type => :user.to_s).first()
+
+ if user.nil?
+ @logger.error("Could not find user with id #{subject_id.inspect}")
+ raise ACM::ObjectNotFound.new("#{subject_id.inspect}")
end
- end
- subject = Yajl::Parser.parse(user_json, :symbolize_keys => true)
+ @logger.debug("Found user #{user.inspect}")
+ user
+ end
+ rescue => e
+ if e.kind_of?(ACM::ACMError)
+ raise e
+ else
+ @logger.error("Internal error #{e.message}")
+ raise ACM::SystemInternalError.new()
+ end
end
-
- @logger.debug("Found subject #{subject.inspect}")
- subject
end
def add_subjects_to_ace(obj_id, permissions, subject_id)
@@ -242,17 +293,17 @@ def add_subjects_to_ace(obj_id, permissions, subject_id)
raise ACM::InvalidRequest.new()
end
- subject = get_subject(subject_id)
+ subject = find_subject(subject_id)
object = nil
if permissions.respond_to?(:each)
ACM::Config.db.transaction do
permissions.each { |permission|
- object = add_permission(obj_id, permission, subject[:id])
+ object = add_permission(obj_id, permission, subject.immutable_id)
}
end
else
- object = add_permission(obj_id, permissions, subject[:id])
+ object = add_permission(obj_id, permissions, subject.immutable_id)
end
object
View
4 lib/acm/services/user_service.rb
@@ -17,7 +17,6 @@ module ACM::Services
class UserService < ACMService
def create_user(opts = {})
-
user = ACM::Models::Subjects.new(
:immutable_id => !opts[:id].nil? ? opts[:id] : SecureRandom.uuid(),
:type => :user.to_s,
@@ -48,9 +47,6 @@ def create_user(opts = {})
def find_user(user_id)
@logger.debug("find_user parameters #{user_id.inspect}")
- if user_id.to_s.index("g-") == 0
- user_id = user_id.to_s.sub(/(g-)/, '')
- end
user = ACM::Models::Subjects.filter(:immutable_id => user_id, :type => :user.to_s).first()
if user.nil?
View
2  spec/functional/auth_controller_spec.rb
@@ -37,7 +37,7 @@ def app
get "/"
@logger.debug("Auth response #{last_response.inspect}")
last_response.status.should eql(404)
- last_response.original_headers["Content-Type"].should eql("application/json;charset=utf-8, schema=urn:acm:schemas:1.0")
+ last_response.original_headers["Content-Type"].should eql("application/json;charset=utf-8")
last_response.original_headers["Content-Length"].should_not eql("0")
body = Yajl::Parser.parse(last_response.body, :symbolize_keys => true)
body[:code].should eql(1000)
View
6 spec/functional/group_controller_spec.rb
@@ -34,7 +34,7 @@ def app
post "/groups/#{SecureRandom.uuid}", { "CONTENT_TYPE" => "application/json", :input => "group_data" }
@logger.debug("post /groups last response #{last_response.inspect}")
last_response.status.should eql(400)
- last_response.original_headers["Content-Type"].should eql("application/json;charset=utf-8, schema=urn:acm:schemas:1.0")
+ last_response.original_headers["Content-Type"].should eql("application/json;charset=utf-8")
last_response.original_headers["Content-Length"].should_not eql("0")
body = Yajl::Parser.parse(last_response.body, :symbolize_keys => true)
@@ -52,7 +52,7 @@ def app
post "/groups/#{SecureRandom.uuid}", {}, { "CONTENT_TYPE" => "application/json", :input => nil }
@logger.debug("post /groups last response #{last_response.inspect}")
last_response.status.should eql(400)
- last_response.original_headers["Content-Type"].should eql("application/json;charset=utf-8, schema=urn:acm:schemas:1.0")
+ last_response.original_headers["Content-Type"].should eql("application/json;charset=utf-8")
last_response.original_headers["Content-Length"].should_not eql("0")
body = Yajl::Parser.parse(last_response.body, :symbolize_keys => true)
@@ -96,7 +96,7 @@ def app
post "/groups/#{group_data[:id]}", {}, { "CONTENT_TYPE" => "application/json", :input => group_data.to_json() }
@logger.debug("post /groups last response #{last_response.inspect}")
last_response.status.should eql(200)
- last_response.original_headers["Content-Type"].should eql("application/json;charset=utf-8, schema=urn:acm:schemas:1.0")
+ last_response.original_headers["Content-Type"].should eql("application/json;charset=utf-8")
last_response.original_headers["Content-Length"].should_not eql("0")
body = Yajl::Parser.parse(last_response.body, :symbolize_keys => true)
View
90 spec/functional/object_controller_spec.rb
@@ -35,7 +35,7 @@ def app
post "/objects", {}, { "CONTENT_TYPE" => "application/json", :input => "object_data" }
@logger.debug("post /objects last response #{last_response.inspect}")
last_response.status.should eql(400)
- last_response.original_headers["Content-Type"].should eql("application/json;charset=utf-8, schema=urn:acm:schemas:1.0")
+ last_response.original_headers["Content-Type"].should eql("application/json;charset=utf-8")
last_response.original_headers["Content-Length"].should_not eql("0")
body = Yajl::Parser.parse(last_response.body, :symbolize_keys => true)
@@ -53,7 +53,7 @@ def app
post "/objects", {}, { "CONTENT_TYPE" => "application/json", :input => nil }
@logger.debug("post /objects last response #{last_response.inspect}")
last_response.status.should eql(400)
- last_response.original_headers["Content-Type"].should eql("application/json;charset=utf-8, schema=urn:acm:schemas:1.0")
+ last_response.original_headers["Content-Type"].should eql("application/json;charset=utf-8")
last_response.original_headers["Content-Length"].should_not eql("0")
body = Yajl::Parser.parse(last_response.body, :symbolize_keys => true)
@@ -112,7 +112,7 @@ def app
post "/objects", {}, { "CONTENT_TYPE" => "application/json", :input => object_data.to_json() }
@logger.debug("post /objects last response #{last_response.inspect}")
last_response.status.should eql(200)
- last_response.original_headers["Content-Type"].should eql("application/json;charset=utf-8, schema=urn:acm:schemas:1.0")
+ last_response.original_headers["Content-Type"].should eql("application/json;charset=utf-8")
last_response.original_headers["Content-Length"].should_not eql("0")
body = Yajl::Parser.parse(last_response.body, :symbolize_keys => true)
@@ -141,7 +141,7 @@ def app
post "/objects", {}, { "CONTENT_TYPE" => "application/json", :input => object_data.to_json() }
@logger.debug("post /objects last response #{last_response.inspect}")
last_response.status.should eql(200)
- last_response.original_headers["Content-Type"].should eql("application/json;charset=utf-8, schema=urn:acm:schemas:1.0")
+ last_response.original_headers["Content-Type"].should eql("application/json;charset=utf-8")
last_response.original_headers["Content-Length"].should_not eql("0")
body = Yajl::Parser.parse(last_response.body, :symbolize_keys => true)
@@ -194,7 +194,7 @@ def app
post "/objects", {}, { "CONTENT_TYPE" => "application/json", :input => object_data.to_json() }
@logger.debug("post /objects last response #{last_response.inspect}")
last_response.status.should eql(200)
- last_response.original_headers["Content-Type"].should eql("application/json;charset=utf-8, schema=urn:acm:schemas:1.0")
+ last_response.original_headers["Content-Type"].should eql("application/json;charset=utf-8")
last_response.original_headers["Content-Length"].should_not eql("0")
body = Yajl::Parser.parse(last_response.body, :symbolize_keys => true)
@@ -239,7 +239,7 @@ def app
post "/objects", {}, { "CONTENT_TYPE" => "application/json", :input => object_data.to_json() }
@logger.debug("post /objects last response #{last_response.inspect}")
last_response.status.should eql(200)
- last_response.original_headers["Content-Type"].should eql("application/json;charset=utf-8, schema=urn:acm:schemas:1.0")
+ last_response.original_headers["Content-Type"].should eql("application/json;charset=utf-8")
last_response.original_headers["Content-Length"].should_not eql("0")
body = Yajl::Parser.parse(last_response.body, :symbolize_keys => true)
@@ -283,7 +283,7 @@ def app
post "/objects", {}, { "CONTENT_TYPE" => "application/json", :input => object_data.to_json() }
@logger.debug("post /objects last response #{last_response.inspect}")
last_response.status.should eql(400)
- last_response.original_headers["Content-Type"].should eql("application/json;charset=utf-8, schema=urn:acm:schemas:1.0")
+ last_response.original_headers["Content-Type"].should eql("application/json;charset=utf-8")
last_response.original_headers["Content-Length"].should_not eql("0")
body = Yajl::Parser.parse(last_response.body, :symbolize_keys => true)
@@ -311,7 +311,7 @@ def app
post "/objects", {}, { "CONTENT_TYPE" => "application/json", :input => object_data.to_json() }
@logger.debug("post /objects last response #{last_response.inspect}")
last_response.status.should eql(400)
- last_response.original_headers["Content-Type"].should eql("application/json;charset=utf-8, schema=urn:acm:schemas:1.0")
+ last_response.original_headers["Content-Type"].should eql("application/json;charset=utf-8")
last_response.original_headers["Content-Length"].should_not eql("0")
body = Yajl::Parser.parse(last_response.body, :symbolize_keys => true)
@@ -365,7 +365,7 @@ def app
post "/objects", {}, { "CONTENT_TYPE" => "application/json", :input => object_data.to_json() }
@logger.debug("post /objects last response #{last_response.inspect}")
last_response.status.should eql(200)
- last_response.original_headers["Content-Type"].should eql("application/json;charset=utf-8, schema=urn:acm:schemas:1.0")
+ last_response.original_headers["Content-Type"].should eql("application/json;charset=utf-8")
last_response.original_headers["Content-Length"].should_not eql("0")
body = Yajl::Parser.parse(last_response.body, :symbolize_keys => true)
@@ -374,7 +374,7 @@ def app
get "/objects/#{body[:id]}", {}, { "CONTENT_TYPE" => "application/json" }
@logger.debug("get /objects/#{body[:id]} last response #{last_response.inspect}")
last_response.status.should eql(200)
- last_response.original_headers["Content-Type"].should eql("application/json;charset=utf-8, schema=urn:acm:schemas:1.0")
+ last_response.original_headers["Content-Type"].should eql("application/json;charset=utf-8")
last_response.original_headers["Content-Length"].should_not eql("0")
fetched_object = last_response.body
@@ -389,7 +389,7 @@ def app
get "/objects/1234", {}, { "CONTENT_TYPE" => "application/json" }
last_response.status.should eql(404)
- last_response.original_headers["Content-Type"].should eql("application/json;charset=utf-8, schema=urn:acm:schemas:1.0")
+ last_response.original_headers["Content-Type"].should eql("application/json;charset=utf-8")
last_response.original_headers["Content-Length"].should_not eql("0")
body = Yajl::Parser.parse(last_response.body, :symbolize_keys => true)
@@ -404,7 +404,7 @@ def app
get "/objects/", {}, { "CONTENT_TYPE" => "application/json" }
last_response.status.should eql(404)
- last_response.original_headers["Content-Type"].should eql("application/json;charset=utf-8, schema=urn:acm:schemas:1.0")
+ last_response.original_headers["Content-Type"].should eql("application/json;charset=utf-8")
last_response.original_headers["Content-Length"].should_not eql("0")
body = Yajl::Parser.parse(last_response.body, :symbolize_keys => true)
@@ -459,7 +459,7 @@ def app
post "/objects", {}, { "CONTENT_TYPE" => "application/json", :input => object_data.to_json() }
@logger.debug("post /objects last response #{last_response.inspect}")
last_response.status.should eql(200)
- last_response.original_headers["Content-Type"].should eql("application/json;charset=utf-8, schema=urn:acm:schemas:1.0")
+ last_response.original_headers["Content-Type"].should eql("application/json;charset=utf-8")
last_response.original_headers["Content-Length"].should_not eql("0")
body = Yajl::Parser.parse(last_response.body, :symbolize_keys => true)
@@ -468,12 +468,12 @@ def app
delete "/objects/#{body[:id]}", {}, { "CONTENT_TYPE" => "application/json" }
@logger.debug("delete /objects/#{body[:id]} last response #{last_response.inspect}")
last_response.status.should eql(200)
- last_response.original_headers["Content-Type"].should eql("application/json;charset=utf-8, schema=urn:acm:schemas:1.0")
+ last_response.original_headers["Content-Type"].should eql("application/json;charset=utf-8")
last_response.original_headers["Content-Length"].should eql("0")
get "/objects/#{body[:id]}", {}, { "CONTENT_TYPE" => "application/json" }
last_response.status.should eql(404)
- last_response.original_headers["Content-Type"].should eql("application/json;charset=utf-8, schema=urn:acm:schemas:1.0")
+ last_response.original_headers["Content-Type"].should eql("application/json;charset=utf-8")
last_response.original_headers["Content-Length"].should_not eql("0")
body = Yajl::Parser.parse(last_response.body, :symbolize_keys => true)
@@ -497,7 +497,7 @@ def app
post "/objects", {}, { "CONTENT_TYPE" => "application/json", :input => object_data.to_json() }
@logger.debug("post /objects last response #{last_response.inspect}")
last_response.status.should eql(200)
- last_response.original_headers["Content-Type"].should eql("application/json;charset=utf-8, schema=urn:acm:schemas:1.0")
+ last_response.original_headers["Content-Type"].should eql("application/json;charset=utf-8")
last_response.original_headers["Content-Length"].should_not eql("0")
body = Yajl::Parser.parse(last_response.body, :symbolize_keys => true)
@@ -531,7 +531,7 @@ def app
delete "/objects/1234", {}, { "CONTENT_TYPE" => "application/json" }
last_response.status.should eql(404)
- last_response.original_headers["Content-Type"].should eql("application/json;charset=utf-8, schema=urn:acm:schemas:1.0")
+ last_response.original_headers["Content-Type"].should eql("application/json;charset=utf-8")
last_response.original_headers["Content-Length"].should_not eql("0")
body = Yajl::Parser.parse(last_response.body, :symbolize_keys => true)
@@ -546,7 +546,7 @@ def app
delete "/objects/", {}, { "CONTENT_TYPE" => "application/json" }
last_response.status.should eql(404)
- last_response.original_headers["Content-Type"].should eql("application/json;charset=utf-8, schema=urn:acm:schemas:1.0")
+ last_response.original_headers["Content-Type"].should eql("application/json;charset=utf-8")
last_response.original_headers["Content-Length"].should_not eql("0")
body = Yajl::Parser.parse(last_response.body, :symbolize_keys => true)
@@ -631,7 +631,7 @@ def app
get "/objects/#{@object[:id]}/users", {}, { "CONTENT_TYPE" => "application/json" }
@logger.debug("get /objects/#{@object[:id]}/users last response #{last_response.inspect}")
last_response.status.should eql(200)
- last_response.original_headers["Content-Type"].should eql("application/json;charset=utf-8, schema=urn:acm:schemas:1.0")
+ last_response.original_headers["Content-Type"].should eql("application/json;charset=utf-8")
last_response.original_headers["Content-Length"].should_not eql("0")
user_permission_map = Yajl::Parser.parse(last_response.body, :symbolize_keys => true)
@@ -722,7 +722,7 @@ def app
put "/objects/#{@object[:id]}/acl?id=#{@user4}&p=delete_appspace", {}, { "CONTENT_TYPE" => "application/json" }
@logger.debug("put /objects/#{@object[:id]}/acl?id=#{@user4}&p=delete_appspace last response #{last_response.inspect}")
last_response.status.should eql(200)
- last_response.original_headers["Content-Type"].should eql("application/json;charset=utf-8, schema=urn:acm:schemas:1.0")
+ last_response.original_headers["Content-Type"].should eql("application/json;charset=utf-8")
last_response.original_headers["Content-Length"].should_not eql("0")
updated_object = Yajl::Parser.parse(last_response.body, :symbolize_keys => true)
@@ -740,7 +740,7 @@ def app
delete "/objects/#{@object[:id]}/acl?id=#{@user2}&p=read_appspace,write_appspace", {}, { "CONTENT_TYPE" => "application/json" }
@logger.debug("delete /objects/#{@object[:id]}/acl?id=#{@user2}&p=read_appspace,write_appspace last response #{last_response.inspect}")
last_response.status.should eql(200)
- last_response.original_headers["Content-Type"].should eql("application/json;charset=utf-8, schema=urn:acm:schemas:1.0")
+ last_response.original_headers["Content-Type"].should eql("application/json;charset=utf-8")
last_response.original_headers["Content-Length"].should_not eql("0")
updated_object = Yajl::Parser.parse(last_response.body, :symbolize_keys => true)
@@ -759,7 +759,7 @@ def app
delete "/objects/#{@object[:id]}/acl?id=#{@user1}&p=read_appspace", {}, { "CONTENT_TYPE" => "application/json" }
@logger.debug("delete /objects/#{@object[:id]}/acl?id=#{@user1}&p=read_appspace last response #{last_response.inspect}")
last_response.status.should eql(200)
- last_response.original_headers["Content-Type"].should eql("application/json;charset=utf-8, schema=urn:acm:schemas:1.0")
+ last_response.original_headers["Content-Type"].should eql("application/json;charset=utf-8")
last_response.original_headers["Content-Length"].should_not eql("0")
updated_object = Yajl::Parser.parse(last_response.body, :symbolize_keys => true)
@@ -777,7 +777,7 @@ def app
delete "/objects/#{@object[:id]}/acl?id=#{@user1}&p=read_appspace", {}, { "CONTENT_TYPE" => "application/json" }
@logger.debug("delete /objects/#{@object[:id]}/acl?id=#{@user1}&p=read_appspace last response #{last_response.inspect}")
last_response.status.should eql(200)
- last_response.original_headers["Content-Type"].should eql("application/json;charset=utf-8, schema=urn:acm:schemas:1.0")
+ last_response.original_headers["Content-Type"].should eql("application/json;charset=utf-8")
last_response.original_headers["Content-Length"].should_not eql("0")
updated_object = Yajl::Parser.parse(last_response.body, :symbolize_keys => true)
@@ -795,7 +795,7 @@ def app
delete "/objects/#{@object[:id]}/acl?id=#{@user1}&p=read_appspace", {}, { "CONTENT_TYPE" => "application/json" }
@logger.debug("delete /objects/#{@object[:id]}/acl?id=#{@user1}&p=read_appspace last response #{last_response.inspect}")
last_response.status.should eql(200)
- last_response.original_headers["Content-Type"].should eql("application/json;charset=utf-8, schema=urn:acm:schemas:1.0")
+ last_response.original_headers["Content-Type"].should eql("application/json;charset=utf-8")
last_response.original_headers["Content-Length"].should_not eql("0")
updated_object = Yajl::Parser.parse(last_response.body, :symbolize_keys => true)
@@ -813,7 +813,7 @@ def app
delete "/objects/#{@object[:id]}/acl?id=#{@user1}&p=read_appspace", {}, { "CONTENT_TYPE" => "application/json" }
@logger.debug("delete /objects/#{@object[:id]}/acl?id=#{@user1}&p=read_appspace last response #{last_response.inspect}")
last_response.status.should eql(200)
- last_response.original_headers["Content-Type"].should eql("application/json;charset=utf-8, schema=urn:acm:schemas:1.0")
+ last_response.original_headers["Content-Type"].should eql("application/json;charset=utf-8")
last_response.original_headers["Content-Length"].should_not eql("0")
updated_object = Yajl::Parser.parse(last_response.body, :symbolize_keys => true)
@@ -833,7 +833,7 @@ def app
@logger.debug("delete /objects/#{@object[:id]}/acl?id=#{@user4}&p=delete_appspace,add_app_to_appspace,remove_app_from_appspace last response #{last_response.inspect}")
last_response.status.should eql(400)
- last_response.original_headers["Content-Type"].should eql("application/json;charset=utf-8, schema=urn:acm:schemas:1.0")
+ last_response.original_headers["Content-Type"].should eql("application/json;charset=utf-8")
last_response.original_headers["Content-Length"].should_not eql("0")
body = Yajl::Parser.parse(last_response.body, :symbolize_keys => true)
@@ -849,7 +849,7 @@ def app
put "/objects/#{@object[:id]}/acl?id=#{@user4}&p=write_appspace", {}, { "CONTENT_TYPE" => "application/json" }
@logger.debug("put /objects/#{@object[:id]}/acl?id=#{@user4}&p=write_appspace last response #{last_response.inspect}")
last_response.status.should eql(200)
- last_response.original_headers["Content-Type"].should eql("application/json;charset=utf-8, schema=urn:acm:schemas:1.0")
+ last_response.original_headers["Content-Type"].should eql("application/json;charset=utf-8")
last_response.original_headers["Content-Length"].should_not eql("0")
updated_object = Yajl::Parser.parse(last_response.body, :symbolize_keys => true)
@@ -867,7 +867,7 @@ def app
put "/objects/#{@object[:id]}/acl?id=#{@user4}&p=read_appspace", {}, { "CONTENT_TYPE" => "application/json" }
@logger.debug("put /objects/#{@object[:id]}/acl?id=#{@user4}&p=read_appspace last response #{last_response.inspect}")
last_response.status.should eql(200)
- last_response.original_headers["Content-Type"].should eql("application/json;charset=utf-8, schema=urn:acm:schemas:1.0")
+ last_response.original_headers["Content-Type"].should eql("application/json;charset=utf-8")
last_response.original_headers["Content-Length"].should_not eql("0")
updated_object = Yajl::Parser.parse(last_response.body, :symbolize_keys => true)
@@ -886,7 +886,7 @@ def app
put "/objects/#{@object[:id]}/acl?id=#{@user7}&p=read_appspace,write_appspace", {}, { "CONTENT_TYPE" => "application/json" }
@logger.debug("put /objects/#{@object[:id]}/acl?id=#{@user7}&p=read_appspace,write_appspace last response #{last_response.inspect}")
last_response.status.should eql(200)
- last_response.original_headers["Content-Type"].should eql("application/json;charset=utf-8, schema=urn:acm:schemas:1.0")
+ last_response.original_headers["Content-Type"].should eql("application/json;charset=utf-8")
last_response.original_headers["Content-Length"].should_not eql("0")
updated_object = Yajl::Parser.parse(last_response.body, :symbolize_keys => true)
@@ -906,7 +906,7 @@ def app
put "/objects/#{@object[:id]}/acl?id=#{@user1}&p=read_appspace", {}, { "CONTENT_TYPE" => "application/json" }
@logger.debug("put /objects/#{@object[:id]}/acl?id=#{@user1}&p=read_appspace last response #{last_response.inspect}")
last_response.status.should eql(200)
- last_response.original_headers["Content-Type"].should eql("application/json;charset=utf-8, schema=urn:acm:schemas:1.0")
+ last_response.original_headers["Content-Type"].should eql("application/json;charset=utf-8")
last_response.original_headers["Content-Length"].should_not eql("0")
updated_object = Yajl::Parser.parse(last_response.body, :symbolize_keys => true)
@@ -925,7 +925,7 @@ def app
put "/objects/#{@object[:id]}/acl?id=#{@user1}&p=clobber_appspace", {}, { "CONTENT_TYPE" => "application/json" }
@logger.debug("put /objects/#{@object[:id]}/acl?id=#{@user1}&p=clobber_appspace last response #{last_response.inspect}")
last_response.status.should eql(400)
- last_response.original_headers["Content-Type"].should eql("application/json;charset=utf-8, schema=urn:acm:schemas:1.0")
+ last_response.original_headers["Content-Type"].should eql("application/json;charset=utf-8")
last_response.original_headers["Content-Length"].should_not eql("0")
error = Yajl::Parser.parse(last_response.body, :symbolize_keys => true)
@@ -941,7 +941,7 @@ def app
put "/objects/#{@object[:id]}/acl?id=#{@user1}&p=read_appspace,clobber_appspace", {}, { "CONTENT_TYPE" => "application/json" }
@logger.debug("put /objects/#{@object[:id]}/acl?id=#{@user1}&p=read_appspace,clobber_appspace last response #{last_response.inspect}")
last_response.status.should eql(400)
- last_response.original_headers["Content-Type"].should eql("application/json;charset=utf-8, schema=urn:acm:schemas:1.0")
+ last_response.original_headers["Content-Type"].should eql("application/json;charset=utf-8")
last_response.original_headers["Content-Length"].should_not eql("0")
error = Yajl::Parser.parse(last_response.body, :symbolize_keys => true)
@@ -959,7 +959,7 @@ def app
put "/objects/#{new_object_id}/acl?id=#{@user1}&p=read_appspace", {}, { "CONTENT_TYPE" => "application/json" }
@logger.debug("put /objects/#{new_object_id}/acl?id=#{@user1}&p=read_appspace last response #{last_response.inspect}")
last_response.status.should eql(404)
- last_response.original_headers["Content-Type"].should eql("application/json;charset=utf-8, schema=urn:acm:schemas:1.0")
+ last_response.original_headers["Content-Type"].should eql("application/json;charset=utf-8")
last_response.original_headers["Content-Length"].should_not eql("0")
error = Yajl::Parser.parse(last_response.body, :symbolize_keys => true)
@@ -969,7 +969,7 @@ def app
error[:description].should include("not found")
end
- it "should not create a user that does not exist and instead return ane error" do
+ it "should not create a user that does not exist and instead return an error" do
basic_authorize "admin", "password"
new_user = SecureRandom.uuid
@@ -991,7 +991,7 @@ def app
put "/objects/#{@object[:id]}/acl?id=g-#{@group1}&p=read_appspace", {}, { "CONTENT_TYPE" => "application/json" }
@logger.debug("put /objects/#{@object[:id]}/acl?id=g-#{@group1}&p=read_appspace last response #{last_response.inspect}")
last_response.status.should eql(200)
- last_response.original_headers["Content-Type"].should eql("application/json;charset=utf-8, schema=urn:acm:schemas:1.0")
+ last_response.original_headers["Content-Type"].should eql("application/json;charset=utf-8")
last_response.original_headers["Content-Length"].should_not eql("0")
updated_object = Yajl::Parser.parse(last_response.body, :symbolize_keys => true)
@@ -1009,7 +1009,7 @@ def app
put "/objects/#{@object[:id]}/acl?id=g-#{@group2}&p=read_appspace", {}, { "CONTENT_TYPE" => "application/json" }
@logger.debug("put /objects/#{@object[:id]}/acl?id=g-#{@group2}&p=read_appspace last response #{last_response.inspect}")
last_response.status.should eql(200)
- last_response.original_headers["Content-Type"].should eql("application/json;charset=utf-8, schema=urn:acm:schemas:1.0")
+ last_response.original_headers["Content-Type"].should eql("application/json;charset=utf-8")
last_response.original_headers["Content-Length"].should_not eql("0")
updated_object = Yajl::Parser.parse(last_response.body, :symbolize_keys => true)
@@ -1029,7 +1029,7 @@ def app
put "/objects/#{@object[:id]}/acl?id=g-#{new_group}&p=read_appspace", {}, { "CONTENT_TYPE" => "application/json" }
@logger.debug("put /objects/#{@object[:id]}/acl?id=g-#{new_group}&p=read_appspace last response #{last_response.inspect}")
last_response.status.should eql(404)
- last_response.original_headers["Content-Type"].should eql("application/json;charset=utf-8, schema=urn:acm:schemas:1.0")
+ last_response.original_headers["Content-Type"].should eql("application/json;charset=utf-8")
last_response.original_headers["Content-Length"].should_not eql("0")
error = Yajl::Parser.parse(last_response.body, :symbolize_keys => true)
@@ -1118,7 +1118,7 @@ def app
put "/objects/#{@object[:id]}", {}, { "CONTENT_TYPE" => "application/json", :input => updated_object_data.to_json() }
@logger.debug("post /objects/#{@object[:id]} last response #{last_response.inspect}")
last_response.status.should eql(200)
- last_response.original_headers["Content-Type"].should eql("application/json;charset=utf-8, schema=urn:acm:schemas:1.0")
+ last_response.original_headers["Content-Type"].should eql("application/json;charset=utf-8")
last_response.original_headers["Content-Length"].should_not eql("0")
body = Yajl::Parser.parse(last_response.body, :symbolize_keys => true)
@@ -1148,7 +1148,7 @@ def app
put "/objects/#{@object[:id]}", {}, { "CONTENT_TYPE" => "application/json", :input => updated_object_data.to_json() }
@logger.debug("put /objects/#{@object[:id]} last response #{last_response.inspect}")
last_response.status.should eql(200)
- last_response.original_headers["Content-Type"].should eql("application/json;charset=utf-8, schema=urn:acm:schemas:1.0")
+ last_response.original_headers["Content-Type"].should eql("application/json;charset=utf-8")
last_response.original_headers["Content-Length"].should_not eql("0")
body = Yajl::Parser.parse(last_response.body, :symbolize_keys => true)
@@ -1182,7 +1182,7 @@ def app
put "/objects/#{@object[:id]}", {}, { "CONTENT_TYPE" => "application/json", :input => updated_object_data.to_json() }
@logger.debug("put /objects/#{@object[:id]} last response #{last_response.inspect}")
last_response.status.should eql(200)
- last_response.original_headers["Content-Type"].should eql("application/json;charset=utf-8, schema=urn:acm:schemas:1.0")
+ last_response.original_headers["Content-Type"].should eql("application/json;charset=utf-8")
last_response.original_headers["Content-Length"].should_not eql("0")
body = Yajl::Parser.parse(last_response.body, :symbolize_keys => true)
@@ -1218,7 +1218,7 @@ def app
put "/objects/#{@object[:id]}", {}, { "CONTENT_TYPE" => "application/json" }
@logger.debug("put /objects/#{@object[:id]} last response #{last_response.inspect}")
last_response.status.should eql(200)
- last_response.original_headers["Content-Type"].should eql("application/json;charset=utf-8, schema=urn:acm:schemas:1.0")
+ last_response.original_headers["Content-Type"].should eql("application/json;charset=utf-8")
last_response.original_headers["Content-Length"].should_not eql("0")
body = Yajl::Parser.parse(last_response.body, :symbolize_keys => true)
@@ -1253,7 +1253,7 @@ def app
put "/objects/#{1234}", {}, { "CONTENT_TYPE" => "application/json", :input => updated_object_data.to_json() }
@logger.debug("put /objects/1234 last response #{last_response.inspect}")
last_response.status.should eql(404)
- last_response.original_headers["Content-Type"].should eql("application/json;charset=utf-8, schema=urn:acm:schemas:1.0")
+ last_response.original_headers["Content-Type"].should eql("application/json;charset=utf-8")
last_response.original_headers["Content-Length"].should_not eql("0")
body = Yajl::Parser.parse(last_response.body, :symbolize_keys => true)
@@ -1279,7 +1279,7 @@ def app
put "/objects/#{@object[:id]}", {}, { "CONTENT_TYPE" => "application/json", :input => updated_object_data.to_json() }
@logger.debug("put /objects/#{@object[:id]} last response #{last_response.inspect}")
last_response.status.should eql(400)
- last_response.original_headers["Content-Type"].should eql("application/json;charset=utf-8, schema=urn:acm:schemas:1.0")
+ last_response.original_headers["Content-Type"].should eql("application/json;charset=utf-8")
last_response.original_headers["Content-Length"].should_not eql("0")
body = Yajl::Parser.parse(last_response.body, :symbolize_keys => true)
@@ -1306,7 +1306,7 @@ def app
put "/objects/#{@object[:id]}", {}, { "CONTENT_TYPE" => "application/json", :input => updated_object_data.to_json() }
@logger.debug("put /objects/#{@object[:id]} last response #{last_response.inspect}")
last_response.status.should eql(400)
- last_response.original_headers["Content-Type"].should eql("application/json;charset=utf-8, schema=urn:acm:schemas:1.0")
+ last_response.original_headers["Content-Type"].should eql("application/json;charset=utf-8")
last_response.original_headers["Content-Length"].should_not eql("0")
body = Yajl::Parser.parse(last_response.body, :symbolize_keys => true)
@@ -1333,7 +1333,7 @@ def app
put "/objects", {}, { "CONTENT_TYPE" => "application/json", :input => updated_object_data.to_json() }
@logger.debug("put /objects last response #{last_response.inspect}")
last_response.status.should eql(404)
- last_response.original_headers["Content-Type"].should eql("application/json;charset=utf-8, schema=urn:acm:schemas:1.0")
+ last_response.original_headers["Content-Type"].should eql("application/json;charset=utf-8")
last_response.original_headers["Content-Length"].should_not eql("0")
body = Yajl::Parser.parse(last_response.body, :symbolize_keys => true)
View
50 spec/functional/permission_set_controller_spec.rb
@@ -38,7 +38,7 @@ def app
post "/permission_sets", {}, { "CONTENT_TYPE" => "application/json", :input => permission_set_data.to_json() }
@logger.debug("post /permission_sets last response #{last_response.inspect}")
last_response.status.should eql(200)
- last_response.original_headers["Content-Type"].should eql("application/json;charset=utf-8, schema=urn:acm:schemas:1.0")
+ last_response.original_headers["Content-Type"].should eql("application/json;charset=utf-8")
last_response.original_headers["Content-Length"].should_not eql("0")
body = Yajl::Parser.parse(last_response.body, :symbolize_keys => true)
@@ -63,7 +63,7 @@ def app
post "/permission_sets", {}, { "CONTENT_TYPE" => "application/json", :input => permission_set_data.to_json() }
@logger.debug("post /permission_sets last response #{last_response.inspect}")
last_response.status.should eql(200)
- last_response.original_headers["Content-Type"].should eql("application/json;charset=utf-8, schema=urn:acm:schemas:1.0")
+ last_response.original_headers["Content-Type"].should eql("application/json;charset=utf-8")
last_response.original_headers["Content-Length"].should_not eql("0")
body = Yajl::Parser.parse(last_response.body, :symbolize_keys => true)
@@ -88,7 +88,7 @@ def app
post "/permission_sets", {}, { "CONTENT_TYPE" => "application/json", :input => permission_set_data.to_json() }
@logger.debug("post /permission_sets last response #{last_response.inspect}")
last_response.status.should eql(400)
- last_response.original_headers["Content-Type"].should eql("application/json;charset=utf-8, schema=urn:acm:schemas:1.0")
+ last_response.original_headers["Content-Type"].should eql("application/json;charset=utf-8")
last_response.original_headers["Content-Length"].should_not eql("0")
body = Yajl::Parser.parse(last_response.body, :symbolize_keys => true)
@@ -109,7 +109,7 @@ def app
post "/permission_sets", {}, { "CONTENT_TYPE" => "application/json", :input => permission_set_data.to_json() }
@logger.debug("post /permission_sets last response #{last_response.inspect}")
last_response.status.should eql(400)
- last_response.original_headers["Content-Type"].should eql("application/json;charset=utf-8, schema=urn:acm:schemas:1.0")
+ last_response.original_headers["Content-Type"].should eql("application/json;charset=utf-8")
last_response.original_headers["Content-Length"].should_not eql("0")
body = Yajl::Parser.parse(last_response.body, :symbolize_keys => true)
@@ -125,7 +125,7 @@ def app
post "/permission_sets", {}, { "CONTENT_TYPE" => "application/json" }
@logger.debug("post /permission_sets last response #{last_response.inspect}")
last_response.status.should eql(400)
- last_response.original_headers["Content-Type"].should eql("application/json;charset=utf-8, schema=urn:acm:schemas:1.0")
+ last_response.original_headers["Content-Type"].should eql("application/json;charset=utf-8")
last_response.original_headers["Content-Length"].should_not eql("0")
body = Yajl::Parser.parse(last_response.body, :symbolize_keys => true)
@@ -155,7 +155,7 @@ def app
post "/permission_sets", {}, { "CONTENT_TYPE" => "application/json", :input => permission_set_data.to_json() }
@logger.debug("post /permission_sets last response #{last_response.inspect}")
last_response.status.should eql(200)
- last_response.original_headers["Content-Type"].should eql("application/json;charset=utf-8, schema=urn:acm:schemas:1.0")
+ last_response.original_headers["Content-Type"].should eql("application/json;charset=utf-8")
last_response.original_headers["Content-Length"].should_not eql("0")
body = Yajl::Parser.parse(last_response.body, :symbolize_keys => true)
@@ -166,7 +166,7 @@ def app
get "/permission_sets/#{body[:name]}", {}, { "CONTENT_TYPE" => "application/json" }
@logger.debug("get /permission_sets/#{body[:id]} last response #{last_response.inspect}")
last_response.status.should eql(200)
- last_response.original_headers["Content-Type"].should eql("application/json;charset=utf-8, schema=urn:acm:schemas:1.0")
+ last_response.original_headers["Content-Type"].should eql("application/json;charset=utf-8")
last_response.original_headers["Content-Length"].should_not eql("0")
fetched_ps = last_response.body
@@ -181,7 +181,7 @@ def app
get "/permission_sets/12345", {}, { "CONTENT_TYPE" => "application/json" }
last_response.status.should eql(404)
- last_response.original_headers["Content-Type"].should eql("application/json;charset=utf-8, schema=urn:acm:schemas:1.0")
+ last_response.original_headers["Content-Type"].should eql("application/json;charset=utf-8")
last_response.original_headers["Content-Length"].should_not eql("0")
body = Yajl::Parser.parse(last_response.body, :symbolize_keys => true)
@@ -196,7 +196,7 @@ def app
get "/permission_sets", {}, { "CONTENT_TYPE" => "application/json" }
last_response.status.should eql(404)
- last_response.original_headers["Content-Type"].should eql("application/json;charset=utf-8, schema=urn:acm:schemas:1.0")
+ last_response.original_headers["Content-Type"].should eql("application/json;charset=utf-8")
last_response.original_headers["Content-Length"].should_not eql("0")
body = Yajl::Parser.parse(last_response.body, :symbolize_keys => true)
@@ -237,7 +237,7 @@ def app
put "/permission_sets/#{permission_set_data[:name]}", {}, { "CONTENT_TYPE" => "application/json", :input => permission_set_data.to_json() }
@logger.debug("put /permission_sets/#{permission_set_data[:name]} last response #{last_response.inspect}")
last_response.status.should eql(200)
- last_response.original_headers["Content-Type"].should eql("application/json;charset=utf-8, schema=urn:acm:schemas:1.0")
+ last_response.original_headers["Content-Type"].should eql("application/json;charset=utf-8")
last_response.original_headers["Content-Length"].should_not eql("0")
body = Yajl::Parser.parse(last_response.body, :symbolize_keys => true)
@@ -262,7 +262,7 @@ def app
put "/permission_sets/#{permission_set_data[:name]}", {}, { "CONTENT_TYPE" => "application/json", :input => permission_set_data.to_json() }
@logger.debug("put /permission_sets/#{permission_set_data[:name]} last response #{last_response.inspect}")
last_response.status.should eql(200)
- last_response.original_headers["Content-Type"].should eql("application/json;charset=utf-8, schema=urn:acm:schemas:1.0")
+ last_response.original_headers["Content-Type"].should eql("application/json;charset=utf-8")
last_response.original_headers["Content-Length"].should_not eql("0")
body = Yajl::Parser.parse(last_response.body, :symbolize_keys => true)
@@ -303,7 +303,7 @@ def app
put "/permission_sets/#{permission_set_data[:name]}", {}, { "CONTENT_TYPE" => "application/json", :input => permission_set_data.to_json() }
@logger.debug("put /permission_sets/#{permission_set_data[:name]} last response #{last_response.inspect}")
last_response.status.should eql(200)
- last_response.original_headers["Content-Type"].should eql("application/json;charset=utf-8, schema=urn:acm:schemas:1.0")
+ last_response.original_headers["Content-Type"].should eql("application/json;charset=utf-8")
last_response.original_headers["Content-Length"].should_not eql("0")
body = Yajl::Parser.parse(last_response.body, :symbolize_keys => true)
@@ -356,7 +356,7 @@ def app
put "/permission_sets/#{permission_set_data[:name]}", {}, { "CONTENT_TYPE" => "application/json", :input => permission_set_data.to_json() }
@logger.debug("put /permission_sets/#{permission_set_data[:name]} last response #{last_response.inspect}")
last_response.status.should eql(400)
- last_response.original_headers["Content-Type"].should eql("application/json;charset=utf-8, schema=urn:acm:schemas:1.0")
+ last_response.original_headers["Content-Type"].should eql("application/json;charset=utf-8")
last_response.original_headers["Content-Length"].should_not eql("0")
body = Yajl::Parser.parse(last_response.body, :symbolize_keys => true)
@@ -380,7 +380,7 @@ def app
put "/permission_sets/#{permission_set_data[:name]}", {}, { "CONTENT_TYPE" => "application/json", :input => permission_set_data.to_json() }
@logger.debug("put /permission_sets/#{permission_set_data[:name]} last response #{last_response.inspect}")
last_response.status.should eql(200)
- last_response.original_headers["Content-Type"].should eql("application/json;charset=utf-8, schema=urn:acm:schemas:1.0")
+ last_response.original_headers["Content-Type"].should eql("application/json;charset=utf-8")
last_response.original_headers["Content-Length"].should_not eql("0")
body = Yajl::Parser.parse(last_response.body, :symbolize_keys => true)
@@ -406,7 +406,7 @@ def app
put "/permission_sets/#{permission_set_data[:name]}", {}, { "CONTENT_TYPE" => "application/json", :input => permission_set_data.to_json() }
@logger.debug("put /permission_sets/#{permission_set_data[:name]} last response #{last_response.inspect}")
last_response.status.should eql(404)
- last_response.original_headers["Content-Type"].should eql("application/json;charset=utf-8, schema=urn:acm:schemas:1.0")
+ last_response.original_headers["Content-Type"].should eql("application/json;charset=utf-8")
last_response.original_headers["Content-Length"].should_not eql("0")
body = Yajl::Parser.parse(last_response.body, :symbolize_keys => true)
@@ -428,7 +428,7 @@ def app
put "/permission_sets/#{permission_set_data[:name]}", {}, { "CONTENT_TYPE" => "application/json", :input => permission_set_data.to_json() }
@logger.debug("put /permission_sets last response #{last_response.inspect}")
last_response.status.should eql(404)
- last_response.original_headers["Content-Type"].should eql("application/json;charset=utf-8, schema=urn:acm:schemas:1.0")
+ last_response.original_headers["Content-Type"].should eql("application/json;charset=utf-8")
last_response.original_headers["Content-Length"].should_not eql("0")
body = Yajl::Parser.parse(last_response.body, :symbolize_keys => true)
@@ -450,7 +450,7 @@ def app
put "/permission_sets/#{permission_set_data[:name]}", {}, { "CONTENT_TYPE" => "application/json", :input => permission_set_data.to_json() }
@logger.debug("put /permission_sets last response #{last_response.inspect}")
last_response.status.should eql(400)
- last_response.original_headers["Content-Type"].should eql("application/json;charset=utf-8, schema=urn:acm:schemas:1.0")
+ last_response.original_headers["Content-Type"].should eql("application/json;charset=utf-8")
last_response.original_headers["Content-Length"].should_not eql("0")
body = Yajl::Parser.parse(last_response.body, :symbolize_keys => true)
@@ -466,7 +466,7 @@ def app
put "/permission_sets", {}, { "CONTENT_TYPE" => "application/json" }
@logger.debug("put /permission_sets last response #{last_response.inspect}")
last_response.status.should eql(404)
- last_response.original_headers["Content-Type"].should eql("application/json;charset=utf-8, schema=urn:acm:schemas:1.0")
+ last_response.original_headers["Content-Type"].should eql("application/json;charset=utf-8")
last_response.original_headers["Content-Length"].should_not eql("0")
body = Yajl::Parser.parse(last_response.body, :symbolize_keys => true)
@@ -500,7 +500,7 @@ def app
delete "/permission_sets/app_space", {}, { "CONTENT_TYPE" => "application/json" }
@logger.debug("delete /permission_sets/app_space} last response #{last_response.inspect}")
last_response.status.should eql(200)
- last_response.original_headers["Content-Type"].should eql("application/json;charset=utf-8, schema=urn:acm:schemas:1.0")
+ last_response.original_headers["Content-Type"].should eql("application/json;charset=utf-8")
last_response.original_headers["Content-Length"].should eql("0")
end
@@ -543,7 +543,7 @@ def app
delete "/permission_sets/#{permission_set_data[:name]}", {}, { "CONTENT_TYPE" => "application/json" }
@logger.debug("delete /permission_sets/#{permission_set_data[:name]} last response #{last_response.inspect}")
last_response.status.should eql(400)
- last_response.original_headers["Content-Type"].should eql("application/json;charset=utf-8, schema=urn:acm:schemas:1.0")
+ last_response.original_headers["Content-Type"].should eql("application/json;charset=utf-8")
last_response.original_headers["Content-Length"].should_not eql("0")
body = Yajl::Parser.parse(last_response.body, :symbolize_keys => true)
@@ -567,7 +567,7 @@ def app
put "/permission_sets/#{permission_set_data[:name]}", {}, { "CONTENT_TYPE" => "application/json", :input => permission_set_data.to_json() }
@logger.debug("put /permission_sets/#{permission_set_data[:name]} last response #{last_response.inspect}")
last_response.status.should eql(200)
- last_response.original_headers["Content-Type"].should eql("application/json;charset=utf-8, schema=urn:acm:schemas:1.0")
+ last_response.original_headers["Content-Type"].should eql("application/json;charset=utf-8")
last_response.original_headers["Content-Length"].should_not eql("0")
body = Yajl::Parser.parse(last_response.body, :symbolize_keys => true)
@@ -593,7 +593,7 @@ def app
put "/permission_sets/#{permission_set_data[:name]}", {}, { "CONTENT_TYPE" => "application/json", :input => permission_set_data.to_json() }
@logger.debug("put /permission_sets/#{permission_set_data[:name]} last response #{last_response.inspect}")
last_response.status.should eql(404)
- last_response.original_headers["Content-Type"].should eql("application/json;charset=utf-8, schema=urn:acm:schemas:1.0")
+ last_response.original_headers["Content-Type"].should eql("application/json;charset=utf-8")
last_response.original_headers["Content-Length"].should_not eql("0")
body = Yajl::Parser.parse(last_response.body, :symbolize_keys => true)
@@ -615,7 +615,7 @@ def app
put "/permission_sets/#{permission_set_data[:name]}", {}, { "CONTENT_TYPE" => "application/json", :input => permission_set_data.to_json() }
@logger.debug("put /permission_sets last response #{last_response.inspect}")
last_response.status.should eql(404)
- last_response.original_headers["Content-Type"].should eql("application/json;charset=utf-8, schema=urn:acm:schemas:1.0")
+ last_response.original_headers["Content-Type"].should eql("application/json;charset=utf-8")
last_response.original_headers["Content-Length"].should_not eql("0")
body = Yajl::Parser.parse(last_response.body, :symbolize_keys => true)
@@ -637,7 +637,7 @@ def app
put "/permission_sets/#{permission_set_data[:name]}", {}, { "CONTENT_TYPE" => "application/json", :input => permission_set_data.to_json() }
@logger.debug("put /permission_sets last response #{last_response.inspect}")
last_response.status.should eql(400)
- last_response.original_headers["Content-Type"].should eql("application/json;charset=utf-8, schema=urn:acm:schemas:1.0")
+ last_response.original_headers["Content-Type"].should eql("application/json;charset=utf-8")
last_response.original_headers["Content-Length"].should_not eql("0")
body = Yajl::Parser.parse(last_response.body, :symbolize_keys => true)
@@ -653,7 +653,7 @@ def app
put "/permission_sets", {}, { "CONTENT_TYPE" => "application/json" }
@logger.debug("put /permission_sets last response #{last_response.inspect}")
last_response.status.should eql(404)
- last_response.original_headers["Content-Type"].should eql("application/json;charset=utf-8, schema=urn:acm:schemas:1.0")
+ last_response.original_headers["Content-Type"].should eql("application/json;charset=utf-8")
last_response.original_headers["Content-Length"].should_not eql("0")
body = Yajl::Parser.parse(last_response.body, :symbolize_keys => true)
View
20 spec/functional/user_controller_spec.rb
@@ -34,7 +34,7 @@ def app
post "/users/#{user_id}"
@logger.debug("post /users/#{user_id} last response #{last_response.inspect}")
last_response.status.should eql(200)
- last_response.original_headers["Content-Type"].should eql("application/json;charset=utf-8, schema=urn:acm:schemas:1.0")
+ last_response.original_headers["Content-Type"].should eql("application/json;charset=utf-8")
last_response.original_headers["Content-Length"].should_not eql("0")
user = Yajl::Parser.parse(last_response.body, :symbolize_keys => true)
user[:id].should eql(user_id)
@@ -113,7 +113,7 @@ def app
get "/users/#{@user1}"
@logger.debug("get /users/#{@user1} last response #{last_response.inspect}")
last_response.status.should eql(200)
- last_response.original_headers["Content-Type"].should eql("application/json;charset=utf-8, schema=urn:acm:schemas:1.0")
+ last_response.original_headers["Content-Type"].should eql("application/json;charset=utf-8")
last_response.original_headers["Content-Length"].should_not eql("0")
user = Yajl::Parser.parse(last_response.body, :symbolize_keys => true)
user[:id].should eql(@user1)
@@ -123,7 +123,7 @@ def app
get "/users/#{@user3}"
@logger.debug("get /users/#{@user3} last response #{last_response.inspect}")
last_response.status.should eql(200)
- last_response.original_headers["Content-Type"].should eql("application/json;charset=utf-8, schema=urn:acm:schemas:1.0")
+ last_response.original_headers["Content-Type"].should eql("application/json;charset=utf-8")
last_response.original_headers["Content-Length"].should_not eql("0")
user = Yajl::Parser.parse(last_response.body, :symbolize_keys => true)
user[:id].should eql(@user3)
@@ -133,7 +133,7 @@ def app
get "/users/#{@user4}"
@logger.debug("get /users/#{@user4} last response #{last_response.inspect}")
last_response.status.should eql(200)
- last_response.original_headers["Content-Type"].should eql("application/json;charset=utf-8, schema=urn:acm:schemas:1.0")
+ last_response.original_headers["Content-Type"].should eql("application/json;charset=utf-8")
last_response.original_headers["Content-Length"].should_not eql("0")
user = Yajl::Parser.parse(last_response.body, :symbolize_keys => true)
user[:id].should eql(@user4)
@@ -143,7 +143,7 @@ def app
get "/users/#{@user5}"
@logger.debug("get /users/#{@user5} last response #{last_response.inspect}")
last_response.status.should eql(200)
- last_response.original_headers["Content-Type"].should eql("application/json;charset=utf-8, schema=urn:acm:schemas:1.0")
+ last_response.original_headers["Content-Type"].should eql("application/json;charset=utf-8")
last_response.original_headers["Content-Length"].should_not eql("0")
user = Yajl::Parser.parse(last_response.body, :symbolize_keys => true)
user[:id].should eql(@user5)
@@ -153,7 +153,7 @@ def app
get "/users/#{@user6}"
@logger.debug("get /users/#{@user6} last response #{last_response.inspect}")
last_response.status.should eql(200)
- last_response.original_headers["Content-Type"].should eql("application/json;charset=utf-8, schema=urn:acm:schemas:1.0")
+ last_response.original_headers["Content-Type"].should eql("application/json;charset=utf-8")
last_response.original_headers["Content-Length"].should_not eql("0")
user = Yajl::Parser.parse(last_response.body, :symbolize_keys => true)
user[:id].should eql(@user6)
@@ -163,7 +163,7 @@ def app
get "/users/#{@user7}"
@logger.debug("get /users/#{@user7} last response #{last_response.inspect}")
last_response.status.should eql(200)
- last_response.original_headers["Content-Type"].should eql("application/json;charset=utf-8, schema=urn:acm:schemas:1.0")
+ last_response.original_headers["Content-Type"].should eql("application/json;charset=utf-8")
last_response.original_headers["Content-Length"].should_not eql("0")
user = Yajl::Parser.parse(last_response.body, :symbolize_keys => true)
user[:id].should eql(@user7)
@@ -173,7 +173,7 @@ def app
get "/users/#{@user8}"
@logger.debug("get /users/#{@user8} last response #{last_response.inspect}")
last_response.status.should eql(200)
- last_response.original_headers["Content-Type"].should eql("application/json;charset=utf-8, schema=urn:acm:schemas:1.0")
+ last_response.original_headers["Content-Type"].should eql("application/json;charset=utf-8")
last_response.original_headers["Content-Length"].should_not eql("0")
user = Yajl::Parser.parse(last_response.body, :symbolize_keys => true)
user[:id].should eql(@user8)
@@ -263,7 +263,7 @@ def app
delete "/users/#{@user8}"
@logger.debug("delete /users/#{@user8} last response #{last_response.inspect}")
last_response.status.should eql(200)
- last_response.original_headers["Content-Type"].should eql("application/json;charset=utf-8, schema=urn:acm:schemas:1.0")
+ last_response.original_headers["Content-Type"].should eql("application/json;charset=utf-8")
last_response.original_headers["Content-Length"].should eql("0")
updated_group = Yajl::Parser.parse(@group_service.find_group("g-#{@group1}"))
@@ -272,7 +272,7 @@ def app
delete "/users/#{@user1}"
@logger.debug("delete /users/#{@user8} last response #{last_response.inspect}")
last_response.status.should eql(200)
- last_response.original_headers["Content-Type"].should eql("application/json;charset=utf-8, schema=urn:acm:schemas:1.0")
+ last_response.original_headers["Content-Type"].should eql("application/json;charset=utf-8")
last_response.original_headers["Content-Length"].should eql("0")
updated_group = Yajl::Parser.parse(@group_service.find_group("g-#{@group2}"))
Please sign in to comment.
Something went wrong with that request. Please try again.