Skip to content

Commit

Permalink
Issue #112 - added test for 2clove crash scenario. It fails. Now... t…
Browse files Browse the repository at this point in the history
…o fix it.
  • Loading branch information
johnhutch committed Jun 2, 2017
1 parent 6dc2fb3 commit 080e562
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions spec/models/meal_plan_spec.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
require 'rails_helper'

RSpec.describe GroceryList, type: :model do
let(:user1) {FactoryGirl.create(:user)}
let(:recipe1) { FactoryGirl.create(:recipe, user: user1, ingredients_block: %Q|5 tbsp soy sauce
4 tbsp mild or hot chili powder
3 tbsp five-spice powder
2 tbsp light muscovado sugar
2 cloves garlic, finely chopped
4 cm piece of fresh ginger, peeled and finely chopped
6 1/2 lbs boneless pork shoulder, rind removed|) }
let(:mealplan1) { FactoryGirl.create(:meal_plan, user: user1) }

it "doesn't crash when subtracting a recipe with a weird unit" do
mealplan1.recipes << recipe1
mealplan1.recipes.delete(recipe1)
expect(mealplan1).to be_valid
end

end

0 comments on commit 080e562

Please sign in to comment.