diff options
author | bry4n <bryann83@gmail.com> | 2014-01-22 07:00:08 +0400 |
---|---|---|
committer | bry4n <bryann83@gmail.com> | 2014-01-22 07:00:08 +0400 |
commit | 0c9707393c409904e1b6842da52b48776a2924aa (patch) | |
tree | aee2972181207fbe225d4d596ebe9538df4cf353 /test | |
parent | d71e5de012b5451824742401ea50e71f1b40bc55 (diff) |
Handle old book site's url path
Diffstat (limited to 'test')
-rw-r--r-- | test/functional/books_controller_test.rb | 6 | ||||
-rw-r--r-- | test/functional/site_controller_test.rb | 11 |
2 files changed, 6 insertions, 11 deletions
diff --git a/test/functional/books_controller_test.rb b/test/functional/books_controller_test.rb index 8b5660d7..f74924d2 100644 --- a/test/functional/books_controller_test.rb +++ b/test/functional/books_controller_test.rb @@ -1,6 +1,12 @@ require 'test_helper' class BooksControllerTest < ActionController::TestCase + + test "redirects old book site" do + get :show, lang: "1_welcome_to_git" + assert_redirected_to controller: "books", action: "show", lang: "en/Getting-Started" + end + test "gets the book page" do book = FactoryGirl.create(:book, :code =>'en') get :show, :lang => 'en' diff --git a/test/functional/site_controller_test.rb b/test/functional/site_controller_test.rb index 37c779b8..b04f85cf 100644 --- a/test/functional/site_controller_test.rb +++ b/test/functional/site_controller_test.rb @@ -12,17 +12,6 @@ class SiteControllerTest < ActionController::TestCase assert_redirected_to "http://git-scm.com/about" end - test "if no slug then should redirect to the book page" do - get :redirect_combook - assert_redirected_to "http://git-scm.com/book" - end - - test "should redirect to particular book page" do - @request.env['PATH_INFO'] = "/5_submodules.html" - get :redirect_combook - assert_redirected_to "http://git-scm.com/book/en/Git-Tools-Submodules" - end - test "should redirect to the book page" do get :redirect_book assert_redirected_to "http://git-scm.com/book" |