ruby on rails - error unit test: underfined assert_not -



ruby on rails - error unit test: underfined assert_not -

i have 2 error when run rake test:

1)error test_should_require_a_following_id(relationtest) nomethoderror:underfined method 'assert_not' #<relationtest:0x3dd0058> 2)error test_should_require_a_follower_id(relationtest) nomethoderror:underfined method 'assert_not' #<relationtest:0x3c1d700>

this relation_test.rb

require 'test_helper' class relationtest < activesupport::testcase def setup @relation = relation.new(follower_id: 9, following_id: 10) end test "should valid" assert @relation.valid? end test "should require follower_id" @relation.follower_id = nil assert_not @relation.valid? end test "should require following_id" @relation.following_id = nil assert_not @relation.valid? end end

my relation model

class relation < activerecord::base attr_accessible :following_id, :follower_id belongs_to :follower, :class_name => "user" belongs_to :following, :class_name => "user" validates :follower_id, presence: true validates :following_id, presence: true end

what can prepare that, please help me! think problem rail vesion(3.2.19), assert @relation.valid?still work??

assert_not has been added in rails 4.0.2. need instead:

assert !@relation.valid?

ruby-on-rails ruby

Comments

Popular posts from this blog

Delphi change the assembly code of a running process -

json - Hibernate and Jackson (java.lang.IllegalStateException: Cannot call sendError() after the response has been committed) -

C++ 11 "class" keyword -