Skip to content

Commit

Permalink
Fix - loading routes with single routes files
Browse files Browse the repository at this point in the history
  • Loading branch information
mnabialek committed Oct 10, 2016
1 parent 06eadf1 commit 62a444a
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGELOG.md
@@ -1,5 +1,9 @@
## Release notes

### v0.2.5 (2016-10-10)

- fix loading routes with single files

### v0.2.4 (2016-09-22)

- fix using absolute paths when loading factories
Expand Down
2 changes: 1 addition & 1 deletion src/Models/Module.php
Expand Up @@ -220,7 +220,7 @@ public function routesFilePath($prefix)
*/
public function routePrefix(array $data)
{
return $data ? $data['type'] . '_' : '';
return isset($data['type']) ? $data['type'] . '_' : '';
}

/**
Expand Down
7 changes: 7 additions & 0 deletions tests/Models/ModuleTest.php
Expand Up @@ -449,6 +449,13 @@ public function it_returns_valid_prefix_when_empty_data()
$this->assertSame('', $this->module->routePrefix([]));
}

/** @test */
public function it_returns_valid_prefix_when_nullable_type()
{
$this->createModuleMock([]);
$this->assertSame('', $this->module->routePrefix(['type' => null]));
}

/** @test */
public function it_returns_valid_prefix_when_not_empty_data()
{
Expand Down

0 comments on commit 62a444a

Please sign in to comment.