You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@deltacloud.apache.org by mf...@apache.org on 2012/09/06 12:05:25 UTC
git commit: EC2: Fixed unit tests to use '/' as a root_url
Updated Branches:
refs/heads/master c04882cb2 -> 939d43ede
EC2: Fixed unit tests to use '/' as a root_url
Project: http://git-wip-us.apache.org/repos/asf/deltacloud/repo
Commit: http://git-wip-us.apache.org/repos/asf/deltacloud/commit/939d43ed
Tree: http://git-wip-us.apache.org/repos/asf/deltacloud/tree/939d43ed
Diff: http://git-wip-us.apache.org/repos/asf/deltacloud/diff/939d43ed
Branch: refs/heads/master
Commit: 939d43ede22efbaa40332ea48f05fb3977c3777b
Parents: c04882c
Author: Michal Fojtik <mf...@redhat.com>
Authored: Thu Sep 6 12:05:46 2012 +0200
Committer: Michal fojtik <mf...@redhat.com>
Committed: Thu Sep 6 12:05:46 2012 +0200
----------------------------------------------------------------------
server/lib/ec2/server.rb | 1 +
server/tests/ec2/common.rb | 5 ++++-
server/tests/ec2/server_test.rb | 4 ++--
3 files changed, 7 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/deltacloud/blob/939d43ed/server/lib/ec2/server.rb
----------------------------------------------------------------------
diff --git a/server/lib/ec2/server.rb b/server/lib/ec2/server.rb
index a6c3089..54a3330 100644
--- a/server/lib/ec2/server.rb
+++ b/server/lib/ec2/server.rb
@@ -46,6 +46,7 @@ module Deltacloud::EC2
set :version, config.version
set :root, File.join(File.dirname(__FILE__), '..', '..')
set :public_folder, root + '/public'
+ set :views, File.join(File.dirname(__FILE__), 'views')
error Deltacloud::EC2::QueryParser::InvalidAction do
status 400
http://git-wip-us.apache.org/repos/asf/deltacloud/blob/939d43ed/server/tests/ec2/common.rb
----------------------------------------------------------------------
diff --git a/server/tests/ec2/common.rb b/server/tests/ec2/common.rb
index 727cd99..1be75de 100644
--- a/server/tests/ec2/common.rb
+++ b/server/tests/ec2/common.rb
@@ -19,4 +19,7 @@ end
Deltacloud[:ec2].require!
Deltacloud[:ec2].default_frontend!
-def root_url; Deltacloud.config[:ec2].root_url; end
+# The root_url here is '/' because the application is not
+# mounted and so by default Sinatra mounts it on '/'
+
+def root_url; '/'; end
http://git-wip-us.apache.org/repos/asf/deltacloud/blob/939d43ed/server/tests/ec2/server_test.rb
----------------------------------------------------------------------
diff --git a/server/tests/ec2/server_test.rb b/server/tests/ec2/server_test.rb
index dc07e14..feb1835 100644
--- a/server/tests/ec2/server_test.rb
+++ b/server/tests/ec2/server_test.rb
@@ -11,14 +11,14 @@ describe Deltacloud::EC2::API do
it 'has the config set property' do
Deltacloud::config[:ec2].must_be_kind_of Deltacloud::Server
- root_url.must_equal Deltacloud[:ec2].root_url
+ Deltacloud[:ec2].root_url.must_equal '/ec2'
end
it 'must do a redirection when no Action parameter' do
get root_url
status.must_equal 301
headers['Location'].wont_be_empty
- headers['Location'].must_equal 'http://example.org' + root_url
+ headers['Location'].must_equal 'http://example.org/ec2'
end
it 'must set the Connection header to close' do