2021-11-04 05:12:56 -04:00
|
|
|
# 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
|
|
|
|
|
2022-03-03 10:16:42 -05:00
|
|
|
expect(page).to have_current_path topics_explore_projects_path, ignore_query: true
|
2021-11-04 05:12:56 -04:00
|
|
|
expect(page).to have_content('There are no topics to show.')
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
context 'when topics exist' do
|
2022-04-29 05:09:48 -04:00
|
|
|
let!(:topic) { create(:topic, name: 'topic1', title: 'Topic 1') }
|
2021-11-04 05:12:56 -04:00
|
|
|
|
|
|
|
it 'renders topic list' do
|
|
|
|
visit topics_explore_projects_path
|
|
|
|
|
2022-03-03 10:16:42 -05:00
|
|
|
expect(page).to have_current_path topics_explore_projects_path, ignore_query: true
|
2022-04-29 05:09:48 -04:00
|
|
|
expect(page).to have_content(topic.title)
|
2021-11-04 05:12:56 -04:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|