Ejemplo n.º 1
0
 public function testStoreSuccessWithRedirectToList()
 {
     $object = new Tag();
     $object->id = 1;
     Tag::shouldReceive('create')->once()->andReturn($object);
     $input = ['tag' => 'test', 'slug' => 'test', 'exit' => true];
     $this->call('POST', 'admin/tags', $input);
     $this->assertRedirectedToRoute('admin.tags.index');
 }
Ejemplo n.º 2
0
 /**
  * Show the form for editing the specified resource.
  *
  * @param  Model    $model
  * @return Response
  */
 public function edit(Model $model)
 {
     JavaScript::put(['tags' => Tag::lists('tag')]);
     $tags = implode(', ', $model->tags->lists('tag'));
     $this->layout->content = View::make('admin.edit')->withTags($tags)->withModel($model);
 }