Skip to content

Instantly share code, notes, and snippets.

@wenbert
Created Jan 17, 2012
Embed
What would you like to do?
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