create
actionLimericksController#create
method functions correctly for the happy path.test/controllers/limericks_controller_test.rb
"should create limerick"
User
fixture object one
.limericks_url
limerick: {
title: 'There was an odd fellow named Gus',
limerick_text: "There was an odd fellow named Gus,\nWhen traveling he made such a fuss.\nHe was banned from the train,\nNot allowed on a plane,\nAnd now travels only by bus."
}
assert_difference
to check that the number of Limerick
objects in the database increased by 1.assert_response
to check that the HTTP response has a redirect status code.assert_redirected_to
to check that the HTTP redirect was to the root URL.assert_not_nil
to check that a flash['success']
message was set.rails test -v