sell_spec.rb require 'spec_helper'
describe Sell do pending "add some examples to (or delete) #{FILE}" it "age is must a number" do sell = Sell.new sell.name="12" sell.sex="mm" sell.sex=12 sell.save end end
sell.rb class Sell < ActiveRecord::Base attr_accessible :age, :name, :sex validates_numericality_of :age, :only_integer => true, :greater_than => 0 end
where is Error???
Failures:
1) SellsController GET edit assigns the requested sell as @sell Failure/Error: sell = Sell.create! valid_attributes ActiveRecord::RecordInvalid: Validation failed: Age is not a number # ./spec/controllers/sells_controller_spec.rb:62:in `block (3 levels) in '
2) SellsController POST create with valid params redirects to the created sell Failure/Error: response.should redirect_to(Sell.last) Expected response to be a <:redirect>, but was <200> # ./spec/controllers/sells_controller_spec.rb:84:in `block (