/**
  * Tests the update function in the CommodityController
  * @depends testStore
  * @param void
  * @return void
  */
 public function testUpdate()
 {
     $this->be(User::first());
     $this->runStore($this->input);
     $commoditySaved = Commodity::orderBy('id', 'desc')->take(1)->get()->toArray();
     // Update the commodity
     $this->runUpdate($this->inputUpdate, $commoditySaved[0]['id']);
     $commodityUpdated = Commodity::orderBy('id', 'desc')->take(1)->get()->toArray();
     $this->assertEquals($commodityUpdated[0]['name'], $this->inputUpdate['name']);
     $this->assertEquals($commodityUpdated[0]['description'], $this->inputUpdate['description']);
     $this->assertEquals($commodityUpdated[0]['metric_id'], $this->inputUpdate['unit_of_issue']);
     $this->assertEquals($commodityUpdated[0]['unit_price'], $this->inputUpdate['unit_price']);
     $this->assertEquals($commodityUpdated[0]['item_code'], $this->inputUpdate['item_code']);
     $this->assertEquals($commodityUpdated[0]['storage_req'], $this->inputUpdate['storage_req']);
     $this->assertEquals($commodityUpdated[0]['min_level'], $this->inputUpdate['min_level']);
     $this->assertEquals($commodityUpdated[0]['max_level'], $this->inputUpdate['max_level']);
 }