You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@deltacloud.apache.org by Ladislav Martincik <lm...@redhat.com> on 2010/10/13 09:45:19 UTC
Re: [PATCH aggregator] Fixed rspec template test.
> -------- Original Message --------
> Subject: [PATCH aggregator] Fixed rspec template test.
> Date: Tue, 5 Oct 2010 14:38:06 +0200
> From: jprovazn@redhat.com
> To: deltacloud-devel@lists.fedorahosted.org
> CC: Jan Provaznik <jp...@redhat.com>
>
> From: Jan Provaznik <jp...@redhat.com>
>
> Mocked http request and image provider setup.
> ---
> src/spec/controllers/templates_controller_spec.rb | 4 ++++
> 1 files changed, 4 insertions(+), 0 deletions(-)
>
> diff --git a/src/spec/controllers/templates_controller_spec.rb
> b/src/spec/controllers/templates_controller_spec.rb
> index af837d6..bdd4290 100644
> --- a/src/spec/controllers/templates_controller_spec.rb
> +++ b/src/spec/controllers/templates_controller_spec.rb
> @@ -30,9 +30,13 @@ describe TemplatesController do
> before(:each) do
> UserSession.create(@admin)
> @template = Factory.create(:template)
> + hydra = Typhoeus::Hydra.hydra
> + hydra.stub(:put,
> %r{http://localhost:9090/templates/.*}).and_return(
> + Typhoeus::Response.new(:code => 200))
> end
>
> it "should create a new Image" do
> + mock = Factory.create(:mock_provider)
> lambda do
> post :build, :image => {:template_id => @template.id},
> :targets => ["mock"]
> end.should change(Image, :count).by(1)
> --
> 1.7.2.3
ACK
-- Ladislav