erichexter / twitter.bootstrap.mvc

nuget package to make bootstrap easy with mvc4
Apache License 2.0
248 stars 134 forks source link

Navigation Extension Tests #63

Closed OdeToCode closed 11 years ago

OdeToCode commented 11 years ago

I might be missing something, but when the navigation extensions write out a link for a non-default action of the current controller, the URL isn't correct.

For example, the Url for the Index action of Home is ok ("/"), but for About the link comes out as /about instead of /home/about.

I added a failing test to the project, if this helps.

If I am misunderstanding how to use the navigation extensions, please disregard :)

erichexter commented 11 years ago

took some liberties with making the home disappear for all of its actions. Not sure if it was taking the Opinionated defaults a step too far.

Eric Hexter

blog | http://Hex.LosTechies.com info | http://www.linkedin.com/in/erichexter

On Wed, Jan 30, 2013 at 8:17 PM, K. Scott Allen notifications@github.comwrote:

I might be missing something, but when the navigation extensions write out a link for a non-default action of the current controller, the URL isn't correct.

For example, the Url for the Index action of Home is ok ("/"), but for About the link comes out as /about instead of /home/about.

I added a failing test to the project, if this helps.

If I am misunderstanding how to use the navigation extensions, please

disregard :)

You can merge this Pull Request by running

git pull https://github.com/OdeToCode/twitter.bootstrap.mvc master

Or view, comment on, or merge it at:

https://github.com/erichexter/twitter.bootstrap.mvc/pull/63 Commit Summary

  • added some tests for navigation extensions
  • added some tests for navigation extensions

File Changes

  • A src/NavigationRoutes/UnitTests/Navigation_Extensions_Should.cshttps://github.com/erichexter/twitter.bootstrap.mvc/pull/63/files#diff-0(41)
  • A src/NavigationRoutes/UnitTests/TestDoubles/TestHttpContext.cshttps://github.com/erichexter/twitter.bootstrap.mvc/pull/63/files#diff-1(30)
  • A src/NavigationRoutes/UnitTests/TestDoubles/TestHttpRequest.cshttps://github.com/erichexter/twitter.bootstrap.mvc/pull/63/files#diff-2(30)
  • A src/NavigationRoutes/UnitTests/TestDoubles/TestHttpResponse.cshttps://github.com/erichexter/twitter.bootstrap.mvc/pull/63/files#diff-3(16)
  • A src/NavigationRoutes/UnitTests/TestDoubles/TestViewContext.cshttps://github.com/erichexter/twitter.bootstrap.mvc/pull/63/files#diff-4(26)
  • A src/NavigationRoutes/UnitTests/TestDoubles/TestViewDataContainer.cshttps://github.com/erichexter/twitter.bootstrap.mvc/pull/63/files#diff-5(14)
  • M src/NavigationRoutes/UnitTests/UnitTests.csprojhttps://github.com/erichexter/twitter.bootstrap.mvc/pull/63/files#diff-6(6)

Patch Links:

erichexter commented 11 years ago

I actually do have a test for the current behavior. o_O

https://github.com/erichexter/twitter.bootstrap.mvc/blob/master/src/NavigationRoutes/UnitTests/Navigation_Route_Should.cs#L47

Eric Hexter

blog | http://Hex.LosTechies.com info | http://www.linkedin.com/in/erichexter

On Wed, Jan 30, 2013 at 8:19 PM, Eric Hexter eric.hexter@gmail.com wrote:

took some liberties with making the home disappear for all of its actions. Not sure if it was taking the Opinionated defaults a step too far.

Eric Hexter

blog | http://Hex.LosTechies.com info | http://www.linkedin.com/in/erichexter

On Wed, Jan 30, 2013 at 8:17 PM, K. Scott Allen notifications@github.comwrote:

I might be missing something, but when the navigation extensions write out a link for a non-default action of the current controller, the URL isn't correct.

For example, the Url for the Index action of Home is ok ("/"), but for About the link comes out as /about instead of /home/about.

I added a failing test to the project, if this helps.

If I am misunderstanding how to use the navigation extensions, please

disregard :)

You can merge this Pull Request by running

git pull https://github.com/OdeToCode/twitter.bootstrap.mvc master

Or view, comment on, or merge it at:

https://github.com/erichexter/twitter.bootstrap.mvc/pull/63 Commit Summary

  • added some tests for navigation extensions
  • added some tests for navigation extensions

File Changes

  • A src/NavigationRoutes/UnitTests/Navigation_Extensions_Should.cshttps://github.com/erichexter/twitter.bootstrap.mvc/pull/63/files#diff-0(41)
  • A src/NavigationRoutes/UnitTests/TestDoubles/TestHttpContext.cshttps://github.com/erichexter/twitter.bootstrap.mvc/pull/63/files#diff-1(30)
  • A src/NavigationRoutes/UnitTests/TestDoubles/TestHttpRequest.cshttps://github.com/erichexter/twitter.bootstrap.mvc/pull/63/files#diff-2(30)
  • A src/NavigationRoutes/UnitTests/TestDoubles/TestHttpResponse.cshttps://github.com/erichexter/twitter.bootstrap.mvc/pull/63/files#diff-3(16)
  • A src/NavigationRoutes/UnitTests/TestDoubles/TestViewContext.cshttps://github.com/erichexter/twitter.bootstrap.mvc/pull/63/files#diff-4(26)
  • A src/NavigationRoutes/UnitTests/TestDoubles/TestViewDataContainer.cshttps://github.com/erichexter/twitter.bootstrap.mvc/pull/63/files#diff-5(14)
  • M src/NavigationRoutes/UnitTests/UnitTests.csprojhttps://github.com/erichexter/twitter.bootstrap.mvc/pull/63/files#diff-6(6)

Patch Links:

OdeToCode commented 11 years ago

Oops, I missed that somehow, even though I looked through that code.

erichexter commented 11 years ago

The test is doing too much...showing my laziness. Thinking about it. Your obsetvation is correct. I did not work through the ramifications of dropping the controller name for all home controller actions. I can back that piece out. On Jan 30, 2013 8:25 PM, "K. Scott Allen" notifications@github.com wrote:

Oops, I missed that somehow, even though I looked through that code.

— Reply to this email directly or view it on GitHubhttps://github.com/erichexter/twitter.bootstrap.mvc/pull/63#issuecomment-12924596.