-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Recipes are now grouped by tags. View should use a presenter. See #2.
- Loading branch information
1 parent
431d5e6
commit 21e98a0
Showing
5 changed files
with
41 additions
and
12 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
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
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
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 'test_helper' | ||
require 'tag_steps' | ||
|
||
feature "Recipe Topic Tags" do | ||
include TagSteps | ||
|
||
given(:recipe) { recipes(:one) } | ||
|
||
scenario "tagging a recipe makes it appear under that tag section" do | ||
tag_name = "Planning Tools & Disaster Management" | ||
tag_as_id = tag_name.parameterize('_') | ||
tag_recipe(tag_name) | ||
visit recipes_path | ||
within "##{tag_as_id}.tag" do | ||
assert_content(recipe.name) | ||
end | ||
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,8 @@ | ||
module TagSteps | ||
def tag_recipe(tag) | ||
recipe.topics = [tag] | ||
recipe.save! | ||
recipe.reload | ||
recipe.topics.must_include(tag.downcase) | ||
end | ||
end |