-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
saving status before doing a git fetch
- Loading branch information
Showing
3 changed files
with
21 additions
and
18 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,18 +3,20 @@ | |
# class RecipesControllerTest < ActionController::TestCase | ||
class RecipesControllerTest < ActionDispatch::IntegrationTest | ||
setup do | ||
# sign_in could be @user or users(:one) if we have fixtures | ||
@user = users(:one) | ||
@user = User.new(username: "MYSTRING", email: "[email protected]", admin: true) | ||
sign_in @user | ||
# @recipe = recipes(:one) | ||
end | ||
|
||
|
||
|
||
test "should get index" do | ||
get '/recipes' | ||
assert_response :success | ||
end | ||
|
||
test "should create recipe" do | ||
assert_difference('Recipe.count') do | ||
|
||
post recipes_url, params: { recipe: {name: 'Test Here' } } | ||
post recipes_url, params: { recipe: { name: "SOMEONE", summary: "Something Else", | ||
description: "Something Else", prep_times: "90", servings_made: "3", user_id: "1"} } | ||
end | ||
|
||
assert_redirected_to recipe_path(Recipe.last) | ||
|