> -------- Original Message -------- > Subject: [PATCH aggregator] Fixed rspec template test. > Date: Tue, 5 Oct 2010 14:38:06 +0200 > From: [email protected] > To: [email protected] > CC: Jan Provaznik <[email protected]> > > From: Jan Provaznik <[email protected]> > > 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
