10.1 Iteration E1: Creating a Smarter Cart 9.3 Iteration D3: Adding a button
Once again, get the tests working, and add tests for the smarter cart.
See that the tests fail.
rake test
[deprecated] I18n.enforce_available_locales will default to true in the future. If you really want to skip validation of your locale you can set I18n.enforce_available_locales = false to avoid this message.
[deprecated] I18n.enforce_available_locales will default to true in the future. If you really want to skip validation of your locale you can set I18n.enforce_available_locales = false to avoid this message.
Loaded suite /home/rubys/.rvm/gems/ruby-1.8.7-p374/gems/rake-10.1.1/lib/rake/rake_test_loader
Started
.....
Finished in 0.197952 seconds.
5 tests, 23 assertions, 0 failures, 0 errors
[deprecated] I18n.enforce_available_locales will default to true in the future. If you really want to skip validation of your locale you can set I18n.enforce_available_locales = false to avoid this message.
Loaded suite /home/rubys/.rvm/gems/ruby-1.8.7-p374/gems/rake-10.1.1/lib/rake/rake_test_loader
Started
.......E..............
Finished in 0.437824 seconds.
1) Error:
test_should_create_line_item(LineItemsControllerTest):
ActiveRecord::RecordNotFound: Couldn't find Product without an ID
app/controllers/line_items_controller.rb:50:in `create'
test/functional/line_items_controller_test.rb:21:in `test_should_create_line_item'
test/functional/line_items_controller_test.rb:20:in `test_should_create_line_item'
22 tests, 33 assertions, 0 failures, 1 errors
Errors running test:functionals!
Update parameters passed as well as expected target of redirect
edit test/functional/line_items_controller_test.rb
test "should create line_item" do
assert_difference('LineItem.count') do
post :create, :product_id => products(:ruby).id
end
assert_redirected_to cart_path(assigns(:line_item).cart)
end
Rerun the previously failing test to verify the fix.
ruby -I test test/functional/line_items_controller_test.rb
[deprecated] I18n.enforce_available_locales will default to true in the future. If you really want to skip validation of your locale you can set I18n.enforce_available_locales = false to avoid this message.
Loaded suite test/functional/line_items_controller_test
Started
.......
Finished in 0.299214 seconds.
7 tests, 10 assertions, 0 failures, 0 errors
10.1 Iteration E1: Creating a Smarter Cart 9.3 Iteration D3: Adding a button