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

index.html.haml_spec.rb « subscriptions « jira_connect « views « spec - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 0a4d283a983a0f7533b4bb004bcbb52b64b05916 (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
# frozen_string_literal: true

require 'spec_helper'

RSpec.describe 'jira_connect/subscriptions/index.html.haml' do
  let(:user) { build_stubbed(:user) }

  before do
    allow(view).to receive(:current_user).and_return(user)
    assign(:subscriptions, create_list(:jira_connect_subscription, 1))
  end

  context 'when the user is signed in' do
    it 'shows link to user profile' do
      render

      expect(rendered).to have_link(user.to_reference)
    end
  end

  context 'when the user is not signed in' do
    let(:user) { nil }

    it 'shows "Sign in" link' do
      render

      expect(rendered).to have_link('Sign in to GitLab')
    end
  end
end