Skip to content

Commit

Permalink
Merge ee586fb into 5bc965a
Browse files Browse the repository at this point in the history
  • Loading branch information
josephmancuso committed Jul 19, 2018
2 parents 5bc965a + ee586fb commit 4c6cf39
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
2 changes: 1 addition & 1 deletion masonite/info.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
VERSION = '2.0.11'
VERSION = '2.0.12'
3 changes: 2 additions & 1 deletion masonite/routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -270,4 +270,5 @@ def _prefix(self, prefix):

def _name(self, name):
for route in self.routes:
route.named_route = name + route.named_route
if isinstance(route.named_route, str):
route.named_route = name + route.named_route
9 changes: 8 additions & 1 deletion tests/test_routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,8 +99,15 @@ def test_group_route_sets_name(self):
Get().route('/test/2', 'TestController@show').name('edit')
], name='post.')

def test_group_route_sets_name_for_none_route(self):
look_for = []
routes = RouteGroup([
Get().route('/test/1', 'TestController@show').name('create'),
Get().route('/test/2', 'TestController@show')
], name='post.')

assert routes[0].named_route == 'post.create'
assert routes[1].named_route == 'post.edit'
assert routes[1].named_route == None

def test_flatten_flattens_multiple_lists(self):
routes = [
Expand Down

0 comments on commit 4c6cf39

Please sign in to comment.