spec/item_definition_spec.rb in amee-3.1.2 vs spec/item_definition_spec.rb in amee-3.2.0

- old
+ new

@@ -33,11 +33,11 @@ describe AMEE::Admin::ItemDefinition, "with an authenticated connection" do it "should parse XML correctly" do connection = flexmock "connection" - connection.should_receive(:v3_get).with("/3.3/definitions/BD88D30D1214;full", {}).and_return(fixture('BD88D30D1214.xml')) + connection.should_receive(:v3_get).with("/#{AMEE::Connection.api_version}/definitions/BD88D30D1214;full", {}).and_return(fixture('BD88D30D1214.xml')) @data = AMEE::Admin::ItemDefinition.load(connection,"BD88D30D1214") @data.uid.should == "BD88D30D1214" @data.created.should == DateTime.new(2007,7,27,7,30,44) @data.modified.should == DateTime.new(2011,2,16,8,40,06) @data.name.should == "Bus Generic" @@ -45,11 +45,11 @@ @data.full_path.should == '/definitions/itemDefinitions/BD88D30D1214' end it "should parse JSON correctly" do connection = flexmock "connection" - connection.should_receive(:v3_get).with("/3.3/definitions/BD88D30D1214;full", {}).and_return(fixture('BD88D30D1214.xml')) + connection.should_receive(:v3_get).with("/#{AMEE::Connection.api_version}/definitions/BD88D30D1214;full", {}).and_return(fixture('BD88D30D1214.xml')) @data = AMEE::Admin::ItemDefinition.load(connection,"BD88D30D1214") @data.uid.should == "BD88D30D1214" @data.created.should == DateTime.new(2007,7,27,7,30,44) @data.modified.should == DateTime.new(2011,2,16,8,40,06) @data.name.should == "Bus Generic" @@ -57,12 +57,12 @@ @data.full_path.should == '/definitions/itemDefinitions/BD88D30D1214' end it "should be able to load an item value definition list" do connection = flexmock "connection" - connection.should_receive(:v3_get).with("/3.3/definitions/BD88D30D1214;full", {}).and_return(fixture('BD88D30D1214.xml')) + connection.should_receive(:v3_get).with("/#{AMEE::Connection.api_version}/definitions/BD88D30D1214;full", {}).and_return(fixture('BD88D30D1214.xml')) connection.should_receive(:retries).and_return(0).once - connection.should_receive(:v3_get).with("/3.3/definitions/BD88D30D1214/values;full", {:resultStart=>0, :resultLimit=>10}).and_return(fixture('ivdlist_BD88D30D1214.xml')).once + connection.should_receive(:v3_get).with("/#{AMEE::Connection.api_version}/definitions/BD88D30D1214/values;full", {:resultStart=>0, :resultLimit=>10}).and_return(fixture('ivdlist_BD88D30D1214.xml')).once @data = AMEE::Admin::ItemDefinition.load(connection,"BD88D30D1214") @data.uid.should == "BD88D30D1214" @list=@data.item_value_definition_list @list.length.should==15 @list.first.uid.should=='9813267B616E' \ No newline at end of file