similar to: Question re assert_equal

Displaying 20 results from an estimated 30000 matches similar to: "Question re assert_equal"

2010 Dec 23
6
Difference between rake test:units and individually running ruby -I test test/unit/something_test.rb ?
Here''s my issue: running ruby -I test test/unit/something_test.rb for each of my unit tests works perfectly. However, running rake test:units brings errors in all of them - some object becomes nil for some reason. Why might this be happening? Specifics: the object that is successfully not nil when I run the unit tests one-by-one but becomes nil when I do rake test:units is defined like
2010 Aug 09
6
configure question and passenger
Greetings all. I have seen a couple of diagrams on the net that look like a computer set up as an nginx server and more than one mongrel server running at once. What is the advantage of having more than one mongrel server running? Is there a good how-to that explains it very well. thanks shawn -- You received this message because you are subscribed to the Google Groups "Ruby on Rails:
2010 Dec 06
10
testing chapter: agile web dev withrails
I am working my way through Agile web development with rails and I''m in the testing chapter. when I run the following test(or any other test) I''m new and not sure where to start looking. require ''test_helper'' class ProductTest < ActiveSupport::TestCase # Replace this with your real tests. test "the truth" do assert true end end I
2009 Sep 01
13
Function Testing Reloading Fixtures before assertion
Hey Everyone, I have a function test the is failing (despite the fact the function actually works in the application). I was looking for some debug advice on how to find my problem. Here is the test: def test_should_delete_word assert_equal ''published'', words(:one).status debugger delete :destroy, :id => words(:one).to_param assert_equal
2007 Jul 06
3
assert_equal - problems returning value from controller
Hi, I have the following assert_equal that is returning false. @q seems to be returning niil, but is set in the controller, how can I get hold of this value in my tests? assert_equal ''derby'', @q Thanks Mark -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups
2006 Jan 16
2
My first test - named fixture not autoloading instance variable
I''m trying to write a test like the one at the bottom of page 148 in Agile Rails. I''m using rails 1.0 I''ve created the fixture correctly I''m pretty sure because the test database table is being populated per the fixture. I have what I think is a simple unit test: ========= require File.dirname(__FILE__) + ''/../test_helper'' class CaseTest
2010 Jul 06
28
Is this book dated?
http://apress.com/book/view/9781590597811 I acquired this book and it has the info I thought I wanted; but, I''m not sure. Is there something better more current out there? RESTful oath openid etc.. I''m coming from a wordpress to cake, codeigniter tinkering and forget why I tried rails; but, it seems pretty cool and intuitive. Appreciate the Capistrano rec prior. Super good,
2006 Apr 21
2
NoMethodError with test_read_with_hash
While running the product_test.rb test fixture in the Agile Web Development book (p. 148), but when I run ruby test/unit/product_test.rb, I get the following error: 1) Error: test_read_with_hash(ProductTest): NoMethodError: You have a nil object when you didn''t expect it! You might have expected an instance of Array. The error occured while evaluating nil.[]
2010 Dec 09
15
Rails 3 Active Record query returns "undefined method `loaded?' for #<Array:0x126a4c>"
I am getting this error on an rspec test: undefined method `loaded?'' for #<Array:0x126a4c> When I call: Practice.includes("practice_members").all Practice has_many :practice_members PracticeMember belongs_to :practice Practice.all returns: [#<Practice id: 6, name: "Practice One", created_at: "2010-12-09 15:40:46", updated_at: "2010-12-09
2010 Sep 18
11
Commenting in an ERB without generating a compiling error
Hello, I have the following: <% @projects.each do |project| %> <tr> . <td><%= link_to ''Destroy'', project, :confirm => ''Are you sure?'', :method => :delete %></td> . </tr> <% end %> How can I safely comment out the TD line above? Do I have to use the =begin way? -- You received this message because you
2011 Jan 10
8
Creating a Dynamic/Custom form
I am pretty new at rails and seem to be stuck on an issue. Trying to find a way to get me app admin to create a form on our rails app. These would include: - Select form control type - Select required validation - Select price change if selected How should I even start going at this? -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk"
2006 Mar 04
2
unittest, not loading yml data
Here is my products.yml version_control_book: id: 1 title: Pragmatic Version Control description: How to use version control image_url: /images/sk_svn_small.jpg price: 29.95 date_available: 2005-01-26 00:00:00 automation_book: id: 2 title: Pragmatic Project Automation description: How to automate your project
2006 Jun 25
1
Unit Testing failure
When I run the unit testing code in Unit Testing Models chapter of the Agile Rails book, I get the following error: $ ruby test/unit/cart_test.rb Loaded suite test/unit/cart_test Started F. Finished in 0.21806 seconds. 1) Failure: test_add_duplicate_product(CartTest) [test/unit/cart_test.rb:22]: <4690> expected but was <3579>. 2 tests, 3 assertions, 1 failures, 0 errors require
2012 Jun 13
1
newbie question: where to find documentation?
Hello, I am very new to Ruby on Rails and am currently working my way through the Depot tutorial in the *Agile Web Development with Rails* book. I like to have as much info available as possible when I am learning something new and had a question about where to find documentation. In my specific case I was trying to find more info on the assert and assert_equal functions and tried looking
2010 Aug 06
1
New bie question: Why use assert_equal when there are comparison operators in Rspec?
hi guys, I''m reading up on Rspec, Mocha and some related material to put BDD in my new rails app. I have also checked out Ryan Bates'' railscasts on rspec (that''s how I got to know about Mocha). Reading up on the Rspec''s main site, the main example in http://rspec.rubyforge.org/rspec/1.3.0/ does not show any use of assert_equals. Rather it just uses the
2006 May 22
1
Agile Web Dev unit test fails with fixture instance variable
I''m following Agile Edition 1. On page 148 it suggests using instance variables named after the fixture, for example: assert_equal @version_control_book.id, @product.id When I introduce this type of instance variable into my test, I get the following error: 1) Error: test_not_owner(GroupTest): RuntimeError: Called id for nil, which would mistakenly be 4 -- if you really wanted the
2006 May 19
3
new to rails; problem with testing section in Agile book
Hello, I should give the expected disclaimer that I am brand new to rails and am going through the Agile web development with Rails book right now. I am in the testing section and I can''t get past an error. this is my cart_test.rb test file: require File.dirname(__FILE__) + ''/../test_helper'' class CartTest < Test::Unit::TestCase fixtures :products def setup
2006 Oct 21
6
test_create gets 200 instead of :success
Help! I have a new/create process that works fine in the actual app. But when I test I always get a failure in the test_create section. Here''s some controller code: def new end def create begin @borrower = Borrower.new(params[:borrower]) if @borrower.save flash[:notice] = ''Borrower '' + @borrower.FirstName + '' '' +
2010 Dec 28
14
cerating multiple cjeck boxes using array
i have a registration form ,i want to store data in corresponding user table in that hobbies field ,i want to store all hobbies in one column so i take multiple check boxes and store in one array all checked values for that i am using below tag,but not working,please any suggestion <%= check_box(:user ,:hobbies,:value =>''Games'') %>Games <%= check_box :user ,
2006 Mar 07
3
STI and unit testing
Hi all, I''m having a bit of a problem with unit testing. I''ve simplified my models to try and get my head round it but I''m still struggling. I''m using STI and trying to write tests for the extended models (code below). I''ve written test cases for the extended models which themselves extend the test case for the parent model, so BarTest extends