Skip to content

Instantly share code, notes, and snippets.

@wenbert
Created January 17, 2012 13:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wenbert/1626619 to your computer and use it in GitHub Desktop.
Save wenbert/1626619 to your computer and use it in GitHub Desktop.
class AllergiesControllerTest < ActionController::TestCase
setup do
@allergy = allergies(:allergy_one)
@sample_allergy = {
:name => "allergy_name_sample",
:desc => "allergy_desc_sample",
:patient_id => @allergy.patient_id
}
end
test "should create allergy" do
assert_difference('Allergy.count') do
post :create, :post => @sample_allergy, :patient_id => @allergy.patient_id
end
# post :create, :post => @allergy, :patient_id => @allergy.patient_id
# Rails.logger.info Allergy.count.to_yaml
assert_redirected_to patients_path
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment