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

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'spec/views/jira_connect/subscriptions/index.html.haml_spec.rb')
-rw-r--r--spec/views/jira_connect/subscriptions/index.html.haml_spec.rb30
1 files changed, 30 insertions, 0 deletions
diff --git a/spec/views/jira_connect/subscriptions/index.html.haml_spec.rb b/spec/views/jira_connect/subscriptions/index.html.haml_spec.rb
new file mode 100644
index 00000000000..dcc36c93327
--- /dev/null
+++ b/spec/views/jira_connect/subscriptions/index.html.haml_spec.rb
@@ -0,0 +1,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