spec/data_item_spec.rb in amee-4.3.2 vs spec/data_item_spec.rb in amee-4.4.0
- old
+ new
@@ -61,10 +61,16 @@
@data.values.size.should == 5
@data.values[0][:name].should == "kgCO2 Per Passenger Journey"
@data.values[0][:path].should == "kgCO2PerPassengerJourney"
@data.values[0][:value].should == "0"
@data.values[0][:uid].should == "127612FA4921"
+ @data.amounts[0][:type].should == "CO2"
+ @data.amounts[0][:value].should == 20.0
+ @data.amounts[0][:unit].should == "kg"
+ @data.amounts[1][:type].should == "N2O"
+ @data.amounts[1][:value].should == 2.0
+ @data.amounts[1][:unit].should == "kg"
end
it "should parse choices correctly from XML" do
connection = flexmock "connection"
connection.should_receive(:retries).and_return(0)
@@ -100,9 +106,15 @@
@data.values.size.should == 5
@data.values[0][:name].should == "kgCO2 Per Passenger Journey"
@data.values[0][:path].should == "kgCO2PerPassengerJourney"
@data.values[0][:value].should == "0"
@data.values[0][:uid].should == "127612FA4921"
+ @data.amounts[0][:type].should == "CO2"
+ @data.amounts[0][:value].should == 20.0
+ @data.amounts[0][:unit].should == "kg"
+ @data.amounts[1][:type].should == "N2O"
+ @data.amounts[1][:value].should == 2.0
+ @data.amounts[1][:unit].should == "kg"
end
it "should parse choices correctly from JSON" do
connection = flexmock "connection"
connection.should_receive(:retries).and_return(0)
\ No newline at end of file