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

legacy_routes_spec.rb « requests « spec - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 537ad4054a1cdaf9f84cc9105c496ccf59975309 (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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
# frozen_string_literal: true

require 'spec_helper'

RSpec.describe "Legacy routes", type: :request, feature_category: :system_access do
  let(:user) { create(:user) }
  let(:token) { create(:personal_access_token, user: user) }

  before do
    login_as(user)
  end

  it "/-/profile/audit_log" do
    get "/-/profile/audit_log"
    expect(response).to redirect_to('/-/user_settings/authentication_log')
  end

  it "/-/profile/active_sessions" do
    get "/-/profile/active_sessions"
    expect(response).to redirect_to('/-/user_settings/active_sessions')
  end

  it "/-/profile/personal_access_tokens" do
    get "/-/profile/personal_access_tokens"
    expect(response).to redirect_to('/-/user_settings/personal_access_tokens')

    get "/-/profile/personal_access_tokens?name=GitLab+Dangerbot&scopes=api"
    expect(response).to redirect_to('/-/user_settings/personal_access_tokens?name=GitLab+Dangerbot&scopes=api')
  end

  it "/-/profile/personal_access_tokens/:id/revoke" do
    put "/-/profile/personal_access_tokens/#{token.id}/revoke"
    expect(token.reload).to be_revoked
  end

  it "/-/profile/applications" do
    get "/-/profile/applications"
    expect(response).to redirect_to('/-/user_settings/applications')
  end

  it "/-/profile/password/new" do
    get "/-/profile/password/new"
    expect(response).to redirect_to('/-/user_settings/password/new')

    get "/-/profile/password/new?abc=xyz"
    expect(response).to redirect_to('/-/user_settings/password/new?abc=xyz')
  end

  it "/-/profile/password/edit" do
    get "/-/profile/password/edit"
    expect(response).to redirect_to('/-/user_settings/password/edit')

    get "/-/profile/password/edit?abc=xyz"
    expect(response).to redirect_to('/-/user_settings/password/edit?abc=xyz')
  end
end