summaryrefslogtreecommitdiff
path: root/spec/views/jira_connect/subscriptions/index.html.haml_spec.rb
blob: dcc36c933279ae349aac21dbac9963418b11cc7f (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, [])
  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