-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Issue #112 - added test for 2clove crash scenario. It fails. Now... t…
…o fix it.
- Loading branch information
Showing
1 changed file
with
20 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,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 |