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