Permalink
Browse files

update mocks for changes to parsing of location headers.

  • Loading branch information...
1 parent 3aa8414 commit 8ea78ca5b57cf339cd054f4d4d5a3075fa4c8fb0 @Floppy Floppy committed Jan 19, 2012
@@ -274,9 +274,9 @@
@connection.should_receive(:put).with(MockDataItemPath+"/127612FA4922", :value => 6, :startDate => AMEE::Epoch+1).once.and_return(flexmock(:body => ''))
@connection.should_receive(:delete).with(MockDataItemPath+"/127612FA4923").once.and_return(flexmock(:body => ''))
@connection.should_receive(:post).with(MockDataItemPath,
- :kgCO2PerPassengerJourney => 7, :startDate => AMEE::Epoch+5).once.and_return({'Location'=>'http://foo.com/'})
+ :kgCO2PerPassengerJourney => 7, :startDate => AMEE::Epoch+5).once.and_return(flexmock(:headers_hash => {'Location'=>'http://foo.com/'}))
@connection.should_receive(:post).with(MockDataItemPath,
- :kgCO2PerPassengerJourney => 11, :startDate => AMEE::Epoch+9).once.and_return({'Location'=>'http://foo.com/'})
+ :kgCO2PerPassengerJourney => 11, :startDate => AMEE::Epoch+9).once.and_return(flexmock(:headers_hash => {'Location'=>'http://foo.com/'}))
lambda {
@val.series = TestSeriesTwo
@val.save!
@@ -289,9 +289,9 @@
@connection.should_receive(:put).with(MockDataItemPath+"/127612FA4922", :value => 6, :startDate => AMEE::Epoch+1).once.and_return(flexmock(:body => ''))
@connection.should_receive(:delete).with(MockDataItemPath+"/127612FA4923").once.and_return(flexmock(:body => ''))
@connection.should_receive(:post).with(MockDataItemPath,
- :kgCO2PerPassengerJourney => 7, :startDate => AMEE::Epoch+5).once.and_return({'Location'=>'https://foo.com/'})
+ :kgCO2PerPassengerJourney => 7, :startDate => AMEE::Epoch+5).once.and_return(flexmock(:headers_hash => {'Location'=>'https://foo.com/'}))
@connection.should_receive(:post).with(MockDataItemPath,
- :kgCO2PerPassengerJourney => 11, :startDate => AMEE::Epoch+9).once.and_return({'Location'=>'https://foo.com/'})
+ :kgCO2PerPassengerJourney => 11, :startDate => AMEE::Epoch+9).once.and_return(flexmock(:headers_hash => {'Location'=>'https://foo.com/'}))
lambda {
@val.series = TestSeriesTwo
@val.save!
@@ -206,7 +206,7 @@
with(MockResourceDataItemPath,
:kgCO2PerPassengerJourney=>42,
:startDate=>(AMEE::Epoch+3).xmlschema).
- and_return({'Location'=>'http://foo.com/'})
+ and_return(flexmock(:headers_hash => {'Location'=>'http://foo.com/'}))
@new=AMEE::Data::ItemValue.new(:value=>42,
:start_date=>AMEE::Epoch+3,
:connection=>@connection,
@@ -221,7 +221,7 @@
with(MockResourceDataItemPath,
:kgCO2PerPassengerJourney=>42,
:startDate=>(AMEE::Epoch+3).xmlschema).
- and_return({'Location'=>'https://foo.com/'})
+ and_return(flexmock(:headers_hash => {'Location'=>'https://foo.com/'}))
@new=AMEE::Data::ItemValue.new(:value=>42,
:start_date=>AMEE::Epoch+3,
:connection=>@connection,
Oops, something went wrong.

0 comments on commit 8ea78ca

Please sign in to comment.