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 2010/09/30 13:01:17 UTC

svn commit: r1003013 - in /incubator/deltacloud/trunk: server/tests/instance_states_test.rb server/views/instance_states/show.html.haml tests/mock/step_definitions/api_steps.rb tests/mock/step_definitions/instance_states_steps.rb

Author: mfojtik
Date: Thu Sep 30 11:01:17 2010
New Revision: 1003013

URL: http://svn.apache.org/viewvc?rev=1003013&view=rev
Log:
Removed .png from instance_states diagram

Modified:
    incubator/deltacloud/trunk/server/tests/instance_states_test.rb
    incubator/deltacloud/trunk/server/views/instance_states/show.html.haml
    incubator/deltacloud/trunk/tests/mock/step_definitions/api_steps.rb
    incubator/deltacloud/trunk/tests/mock/step_definitions/instance_states_steps.rb

Modified: incubator/deltacloud/trunk/server/tests/instance_states_test.rb
URL: http://svn.apache.org/viewvc/incubator/deltacloud/trunk/server/tests/instance_states_test.rb?rev=1003013&r1=1003012&r2=1003013&view=diff
==============================================================================
--- incubator/deltacloud/trunk/server/tests/instance_states_test.rb (original)
+++ incubator/deltacloud/trunk/server/tests/instance_states_test.rb Thu Sep 30 11:01:17 2010
@@ -42,7 +42,7 @@ module DeltacloudUnitTest
     end
 
     def test_it_responses_to_png
-      do_request '/api/instance_states.png', {}, false
+      do_request '/api/instance_states', { :format => 'png' }, false
       last_response.status.should == 200
       last_response.headers['Content-Type'].should == 'image/png'
     end

Modified: incubator/deltacloud/trunk/server/views/instance_states/show.html.haml
URL: http://svn.apache.org/viewvc/incubator/deltacloud/trunk/server/views/instance_states/show.html.haml?rev=1003013&r1=1003012&r2=1003013&view=diff
==============================================================================
--- incubator/deltacloud/trunk/server/views/instance_states/show.html.haml (original)
+++ incubator/deltacloud/trunk/server/views/instance_states/show.html.haml Thu Sep 30 11:01:17 2010
@@ -1,7 +1,7 @@
 %h1 Instance States
 
 %div#state_graph
-  = image_tag url_for( '/api/instance_states.png' )
+  = image_tag url_for( '/api/instance_states?format=png' )
 
 %table.states
   %thead

Modified: incubator/deltacloud/trunk/tests/mock/step_definitions/api_steps.rb
URL: http://svn.apache.org/viewvc/incubator/deltacloud/trunk/tests/mock/step_definitions/api_steps.rb?rev=1003013&r1=1003012&r2=1003013&view=diff
==============================================================================
--- incubator/deltacloud/trunk/tests/mock/step_definitions/api_steps.rb (original)
+++ incubator/deltacloud/trunk/tests/mock/step_definitions/api_steps.rb Thu Sep 30 11:01:17 2010
@@ -52,7 +52,15 @@ end
 Then /^this URI should be available in (.+) format$/ do |formats|
   @no_header = true
   formats.split(',').each do |format|
-    get "#{@uri}.#{format.strip.downcase}", {}
+    case format.downcase
+      when 'xml':
+        header 'Accept', 'application/xml;q=9'
+      when 'json'
+        header 'Accept', 'application/json;q=9'
+      when 'html'
+        header 'Accept', 'application/xml+xhtml;q=9'
+    end
+    get @uri, {}
     last_response.status.should == 200
   end
   @no_header = false

Modified: incubator/deltacloud/trunk/tests/mock/step_definitions/instance_states_steps.rb
URL: http://svn.apache.org/viewvc/incubator/deltacloud/trunk/tests/mock/step_definitions/instance_states_steps.rb?rev=1003013&r1=1003012&r2=1003013&view=diff
==============================================================================
--- incubator/deltacloud/trunk/tests/mock/step_definitions/instance_states_steps.rb (original)
+++ incubator/deltacloud/trunk/tests/mock/step_definitions/instance_states_steps.rb Thu Sep 30 11:01:17 2010
@@ -25,7 +25,7 @@ Then /^each transitions should have 'to'
 end
 
 When /^client wants (\w+) format$/ do |format|
-  get "#{@uri}.#{format.downcase}", {}
+  get @uri, { :format => format.downcase }
 end
 
 Then /^client should get PNG image$/ do