summaryrefslogtreecommitdiff
path: root/spec/features/explore/topics_spec.rb
diff options
context:
space:
mode:
Diffstat (limited to 'spec/features/explore/topics_spec.rb')
-rw-r--r--spec/features/explore/topics_spec.rb25
1 files changed, 25 insertions, 0 deletions
diff --git a/spec/features/explore/topics_spec.rb b/spec/features/explore/topics_spec.rb
new file mode 100644
index 00000000000..9d2e76bc3a1
--- /dev/null
+++ b/spec/features/explore/topics_spec.rb
@@ -0,0 +1,25 @@
+# frozen_string_literal: true
+
+require 'spec_helper'
+
+RSpec.describe 'Explore Topics' do
+ context 'when no topics exist' do
+ it 'renders empty message', :aggregate_failures do
+ visit topics_explore_projects_path
+
+ expect(current_path).to eq topics_explore_projects_path
+ expect(page).to have_content('There are no topics to show.')
+ end
+ end
+
+ context 'when topics exist' do
+ let!(:topic) { create(:topic, name: 'topic1') }
+
+ it 'renders topic list' do
+ visit topics_explore_projects_path
+
+ expect(current_path).to eq topics_explore_projects_path
+ expect(page).to have_content('topic1')
+ end
+ end
+end