· 1 min read

Screencast: Exceptions Testen

Download (14.4 MB, 10:01) Alternative download für iPod & Apple TV(11.2 MB, 10:01)

Quellcode:

[bash] script/generate integration_test exceptions rake test:integration [/bash]

[ruby] # test/integration/exceptions_test.rb class ExceptionsTest < ActionController::IntegrationTest fixtures :all

test “POST /products” do post “/products”, “commit”=>“Submit”, “product”=>{“name”=>“Headphones”, “price”=>“-2”} assert_response :success end test “GET /products/8/edit” do product = Product.first get “/products/#{product.id}/edit” assert_response :success end end [/ruby]

Back to Blog