', $content);
- $this->assertContains('
', $content);
- $this->assertContains('50 entries', $content);
+ $app['router']->get('users', ['as' => 'users.index', 'uses' => 'Tests\Setup\Controller\UsersTestController@index']);
+ $app['router']->get('users/create', ['as' => 'users.create', 'uses' => 'Tests\Setup\Controller\UsersTestController@create']);
+ $app['router']->post('users/create', ['as' => 'users.store', 'uses' => 'Tests\Setup\Controller\UsersTestController@store']);
+ $app['router']->get('users/:id', ['as' => 'users.show', 'uses' => 'Tests\Setup\Controller\UsersTestController@show']);
+ $app['router']->patch('users/:id', ['as' => 'users.update', 'uses' => 'Tests\Setup\Controller\UsersTestController@update']);
+ $app['router']->delete('users/:id', ['as' => 'users.destroy', 'uses' => 'Tests\Setup\Controller\UsersTestController@destroy']);
+
+ // customized grid
+ $app['router']->get('userz', ['as' => 'users.index_2', 'uses' => 'Tests\Setup\Controller\UsersTestController@index_two']);
}
}
\ No newline at end of file
diff --git a/tests/TestModels/Role.php b/tests/Setup/TestModels/Role.php
similarity index 90%
rename from tests/TestModels/Role.php
rename to tests/Setup/TestModels/Role.php
index b0423ac..016eba6 100644
--- a/tests/TestModels/Role.php
+++ b/tests/Setup/TestModels/Role.php
@@ -1,6 +1,6 @@
assertEquals(true, Config::get('grid.warn_when_empty'));
+ }
+
+ /**
+ * Test to see if migrations can be run
+ * @test
+ */
+ public function can_run_the_migrations()
+ {
+ $users = DB::table('users')->where('id', '=', 1)->first();
+ $this->assertNotNull($users);
+ }
+
+ /**
+ * Test to see if grid is generated using command option
+ * @test
+ */
+ public function grid_is_generated_using_command()
+ {
+ Artisan::call('make:grid', [
+ '--model' => User::class,
+ ]);
+
+ $resultAsText = Artisan::output();
+
+ $this->assertContains('Finished performing replacements to the stub files', $resultAsText);
+ }
+
+ /**
+ * Test to see if the grid is displayed
+ * @test
+ */
+ public function grid_is_displayed()
+ {
+ $response = $this->get('/users');
+
+ $content = $response->getContent();
+
+ $response->assertStatus(200);
+ $this->assertNotNull($content);
+ $this->assertContains('Users', $content);
+ $this->assertContains('
', $content);
+ $this->assertContains('', $content);
+ $this->assertContains('50 entries', $content);
+ }
+}
\ No newline at end of file