Created
January 9, 2012 12:33
-
-
Save wenbert/1582749 to your computer and use it in GitHub Desktop.
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
require 'test_helper' | |
class AllergiesControllerTest < ActionController::TestCase | |
setup do | |
@allergy = allergies(:one) | |
end | |
test "should get index" do | |
get :index | |
assert_response :success | |
#assert_not_nil assigns(:allergies) | |
end | |
test "should get new" do | |
get :new | |
assert_response :success | |
end | |
test "should create allergy" do | |
assert_difference('Allergy.count') do | |
post :create, allergy: @allergy.attributes | |
end | |
assert_redirected_to allergy_path(assigns(:allergy)) | |
end | |
test "should show allergy" do | |
get :show, id: @allergy.to_param | |
assert_response :success | |
end | |
test "should get edit" do | |
get :edit, id: @allergy.to_param | |
assert_response :success | |
end | |
test "should update allergy" do | |
put :update, id: @allergy.to_param, allergy: @allergy.attributes | |
assert_redirected_to allergy_path(assigns(:allergy)) | |
end | |
test "should destroy allergy" do | |
assert_difference('Allergy.count', -1) do | |
delete :destroy, id: @allergy.to_param | |
end | |
assert_redirected_to allergies_path | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment