Displaying 2 results from an estimated 2 matches for "client_test".
2005 Dec 22
1
How to write unit tests with respect to model callbacks?
...l_messages.join("; ")
@client.reload
assert_equal "TEST UPDATE DESCRIPTION", @client.description
end
def test_destroy
@client.destroy
assert_raise(ActiveRecord::RecordNotFound) { Client.find(@client.id) }
end
end
larik@somehost $ ruby test/unit/client_test.rb
Loaded suite test/unit/client_test
Started
.EE
Finished in 0.577375 seconds.
1) Error:
test_destroy(ClientTest):
NoMethodError: You have a nil object when you didn't expect it!
You might have expected an instance of ActiveRecord::Base.
The error occured while evaluating nil.destroy
/U...
2010 Oct 06
6
Error on running unity test: "no such file to load -- 'active_record/version'"
...ect.
Here it is:
/home/fabricio/shopcell/config/environment.rb:1:in `require'': no such
file to load -- active_record/version (LoadError)
from /home/fabricio/shopcell/config/environment.rb:1
from ./test/test_helper.rb:2:in `require''
from ./test/test_helper.rb:2
from test/unit/client_test.rb:1:in `require''
from test/unit/client_test.rb:1
My application runs smoothly, but I get stuck on this only when trying
running tests.
I know that the statement "require ''active_record''" works when I run
the applications because if I remove this statement fom...