Welcome to mirror list, hosted at ThFree Co, Russian Federation.

site_controller_test.rb « functional « test - github.com/git/git-scm.com.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 596bec7b98864152dd185bc101ff4fbb501af7a6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# frozen_string_literal: true

require "test_helper"

class SiteControllerTest < ActionController::TestCase
  test "should get index" do
    get :index
    assert_response :success
  end

  test "whygitisbetterthanx.com should redirect to about page" do
    get :redirect_wgibtx
    assert_redirected_to "https://git-scm.com/about"
  end

  test "should redirect to the book page" do
    get :redirect_book
    assert_redirected_to "https://git-scm.com/book"
  end

  test "should redirect to any book page" do
    @request.env["PATH_INFO"] = "/en/Git-Tools-Submodules"
    get :redirect_book
    assert_redirected_to "https://git-scm.com/en/Git-Tools-Submodules"
  end

  test "should get search page" do
    get :search, params: { search: "git-rebase" }
    assert_response :success
  end

  test "should get some search results" do
    get :search_results, params: { search: "git-rebase" }
    assert_response :success
  end
end