Skip to content

Commit

Permalink
Make the ingredient brand parenthetical and optional.
Browse files Browse the repository at this point in the history
  • Loading branch information
eee-c committed Mar 29, 2009
1 parent 675dc42 commit 8e05027
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
13 changes: 13 additions & 0 deletions spec/views/recipe.haml_spec.rb
Expand Up @@ -43,6 +43,10 @@
should have_selector(".ingredient > .quantity", :content => '1')
end
end

it "should not render a brand" do
response.should_not have_selector(".ingredient > .brand")
end
end

context "a recipe with 1 cup of all-purpose, unbleached flour" do
Expand Down Expand Up @@ -106,5 +110,14 @@
:content => 'Nestle Tollhouse')
end
end

it "should note the brand parenthetically after the name" do
response.should have_selector(".preparations") do |preparations|
preparations.
should have_selector(".ingredient > .name + .brand",
:content => '(Nestle Tollhouse)')
end

end
end
end
5 changes: 3 additions & 2 deletions views/recipe.haml
Expand Up @@ -13,5 +13,6 @@
= preparation['ingredient']['kind']
%span.name
= preparation['ingredient']['name']
%span.brand
= preparation['brand']
- if preparation['brand']
%span.brand
= "(" + preparation['brand'] + ")"

0 comments on commit 8e05027

Please sign in to comment.