diff options
Diffstat (limited to 'lib/generators/nifty/scaffold/templates/tests/shoulda/actions/destroy.rb')
-rw-r--r-- | lib/generators/nifty/scaffold/templates/tests/shoulda/actions/destroy.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/generators/nifty/scaffold/templates/tests/shoulda/actions/destroy.rb b/lib/generators/nifty/scaffold/templates/tests/shoulda/actions/destroy.rb new file mode 100644 index 0000000..ea20133 --- /dev/null +++ b/lib/generators/nifty/scaffold/templates/tests/shoulda/actions/destroy.rb @@ -0,0 +1,8 @@ + context "destroy action" do + should "destroy model and redirect to index action" do + <%= instance_name %> = <%= class_name %>.first + delete :destroy, :id => <%= instance_name %> + assert_redirected_to <%= items_url %> + assert !<%= class_name %>.exists?(<%= instance_name %>.id) + end + end |