public function haveRecord($model, $attributes = array())
    {
        $id = $this->app['db']->table($model)->insertGetId($attributes);
        if (!$id) {
            $this->fail("Couldn't insert record into table $model");
        }
        return $id;
    }
public function haveRecord($model, $attributes = array())
    {
        $id = $this->app['db']->table($model)->insertGetId($attributes);
        if (!$id) {
            $this->fail("Couldn't insert record into table $model");
        }
        return $id;
    }
public function haveRecord ( $ model , $ attributes = array ( ) ) { $ id = $ this -> app [ 'db' ] -> table ( $ model ) -> insertGetId ( $ attributes ) ; if ( ! $ id ) { $ this -> fail ( "Couldn't insert record into table $model" ) ; } return $ id ; }
Inserts record into the database.

``` php
<?php
$user_id = $I->haveRecord('users', array('name' => 'Davert'));
?>
```

@param $model
@param array $attributes
@return mixed
Inserts record into the database .