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/dashboard/projects/index.html.haml_spec.rb')
-rw-r--r--spec/views/dashboard/projects/index.html.haml_spec.rb28
1 files changed, 28 insertions, 0 deletions
diff --git a/spec/views/dashboard/projects/index.html.haml_spec.rb b/spec/views/dashboard/projects/index.html.haml_spec.rb
new file mode 100644
index 00000000000..72b5901d5e5
--- /dev/null
+++ b/spec/views/dashboard/projects/index.html.haml_spec.rb
@@ -0,0 +1,28 @@
+# frozen_string_literal: true
+
+require 'spec_helper'
+
+RSpec.describe 'dashboard/projects/index.html.haml' do
+ let_it_be(:user) { build(:user) }
+
+ before do
+ allow(view).to receive(:limited_counter_with_delimiter)
+ allow(view).to receive(:current_user).and_return(user)
+ allow(view).to receive(:project_list_cache_key)
+ allow(view).to receive(:time_ago_with_tooltip)
+ allow(view).to receive(:project_icon)
+ assign(:projects, [build(:project, name: 'awesome stuff')])
+ end
+
+ it 'shows the project the user is a member of in the list' do
+ render
+
+ expect(rendered).to have_content('awesome stuff')
+ end
+
+ it 'shows the "New project" button' do
+ render
+
+ expect(rendered).to have_link('New project')
+ end
+end