public function testSave() { $faker = Faker\Factory::create(); $data = ['libelle' => str_replace('\'', '', $faker->realText(20)), 'body_type' => \Distilleries\Expendable\Helpers\StaticLabel::BODY_TYPE_HTML, 'action' => 'emails.password', 'cc' => $faker->email, 'bcc' => $faker->email, 'content' => str_replace('\'', '', $faker->text()), 'status' => \Distilleries\Expendable\Helpers\StaticLabel::STATUS_ONLINE]; $this->call('POST', action($this->controller . '@postEdit'), $data); $total = \Distilleries\Expendable\Models\Email::where('libelle', $data['libelle'])->where('action', $data['action'])->count(); $this->assertEquals(1, $total); }