-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add tests for category detail (#605)
* Add tests for category detail --------- Co-authored-by: Jano Suchal <[email protected]> Co-authored-by: Jan Suchal <[email protected]>
- Loading branch information
1 parent
7a70d51
commit d4f757e
Showing
2 changed files
with
22 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
FactoryBot.define do | ||
factory :categorization do | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |