Return-Path: X-Original-To: apmail-deltacloud-dev-archive@www.apache.org Delivered-To: apmail-deltacloud-dev-archive@www.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id EABFA9D16 for ; Mon, 23 Jan 2012 11:22:47 +0000 (UTC) Received: (qmail 16413 invoked by uid 500); 23 Jan 2012 11:22:47 -0000 Delivered-To: apmail-deltacloud-dev-archive@deltacloud.apache.org Received: (qmail 16393 invoked by uid 500); 23 Jan 2012 11:22:47 -0000 Mailing-List: contact dev-help@deltacloud.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@deltacloud.apache.org Delivered-To: mailing list dev@deltacloud.apache.org Received: (qmail 16385 invoked by uid 99); 23 Jan 2012 11:22:47 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 23 Jan 2012 11:22:47 +0000 X-ASF-Spam-Status: No, hits=-5.0 required=5.0 tests=RCVD_IN_DNSWL_HI,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of mfojtik@redhat.com designates 209.132.183.28 as permitted sender) Received: from [209.132.183.28] (HELO mx1.redhat.com) (209.132.183.28) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 23 Jan 2012 11:22:40 +0000 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q0NBMIQ6027824 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Mon, 23 Jan 2012 06:22:19 -0500 Received: from dhcp-29-121.brq.redhat.com (dhcp-29-121.brq.redhat.com [10.34.29.121]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id q0NBMEAg000835 for ; Mon, 23 Jan 2012 06:22:18 -0500 From: mfojtik@redhat.com To: dev@deltacloud.apache.org Subject: [PATCH core 4/4] Mock: Fixed some failing Cucumber scenarios Date: Mon, 23 Jan 2012 12:23:22 +0100 Message-Id: <1327317802-78828-4-git-send-email-mfojtik@redhat.com> In-Reply-To: <1327317802-78828-1-git-send-email-mfojtik@redhat.com> References: <1327317802-78828-1-git-send-email-mfojtik@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 X-Virus-Checked: Checked by ClamAV on apache.org From: Michal Fojtik Signed-off-by: Michal fojtik --- tests/mock/instances.feature | 1 + tests/mock/step_definitions/api_steps.rb | 4 +++- tests/mock/step_definitions/instances_steps.rb | 5 +++-- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/tests/mock/instances.feature b/tests/mock/instances.feature index 460e7a7..ae49e79 100644 --- a/tests/mock/instances.feature +++ b/tests/mock/instances.feature @@ -48,6 +48,7 @@ Feature: Managing instances | authentication | | public_addresses | | private_addresses | + | storage_volumes | Scenario: Following image href in instance Given URI /api/instances exists diff --git a/tests/mock/step_definitions/api_steps.rb b/tests/mock/step_definitions/api_steps.rb index 1169a97..27d1e8f 100644 --- a/tests/mock/step_definitions/api_steps.rb +++ b/tests/mock/step_definitions/api_steps.rb @@ -1,5 +1,7 @@ +World(Rack::Test::Methods) + Given /^URI ([\w\/\-_]+) exists$/ do |uri| - get uri, {} + get uri last_response.status.should_not == 404 last_response.status.should_not == 500 @uri = uri diff --git a/tests/mock/step_definitions/instances_steps.rb b/tests/mock/step_definitions/instances_steps.rb index fd86903..3016bd8 100644 --- a/tests/mock/step_definitions/instances_steps.rb +++ b/tests/mock/step_definitions/instances_steps.rb @@ -36,10 +36,11 @@ When /^client follow link in actions$/ do l = @instance.xpath('actions/link[@rel="'+@action+'"]').first if @action.eql?('destroy') - delete l[:href], { :id => @instance.xpath('@id').first.text } + delete l[:href] else - post l[:href], { :id => @instance.xpath('@id').first.text } + post l[:href] end + puts last_response.body if last_response.status == 500 last_response.status.should_not == 500 end -- 1.7.4.4