Skip to content

Commit

Permalink
Add tests for category detail (#605)
Browse files Browse the repository at this point in the history
* Add tests for category detail

---------

Co-authored-by: Jano Suchal <[email protected]>
Co-authored-by: Jan Suchal <[email protected]>
  • Loading branch information
3 people authored Oct 7, 2023
1 parent 7a70d51 commit d4f757e
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
4 changes: 4 additions & 0 deletions spec/factories/categorization.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
FactoryBot.define do
factory :categorization do
end
end
18 changes: 18 additions & 0 deletions spec/features/categories_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
require 'rails_helper'

RSpec.feature 'Categories', type: :feature do
scenario 'As a visitor I can see a journey on a category page' do
published_journey = create(:journey, title: "published journey", published_status: 'PUBLISHED')

categorization = create(:categorization, categorizable: published_journey)

category = create(:category, name: "byvanie", categorizations: [categorization])

published_journey.search_documents.update_all(featured: true)

visit category_path(category)

expect(page).to have_text(category.name)
expect(page).to have_text(published_journey.title)
end
end

0 comments on commit d4f757e

Please sign in to comment.