How do I figure out why errors are occurring when running unit tests on app that is being upgraded from Rails 2.3 to Rails 3.0?

I've been tasked with upgrading an app from Rails 2.3.5 to 3.0.19. This also involves upgrading Ruby from 1.8.6 to 1.8.7. After this upgrade is complete and stable, the plan is then to move to Ruby 1.9 and Rails 3.2.

Gems (output from bundle install), fyi:

Using rake (10.0.3)
Using abstract (1.0.0)
Using activesupport (3.0.19)
Using builder (2.1.2)
Using i18n (0.5.0)
Using activemodel (3.0.19)
Using erubis (2.6.6)
Using rack (1.2.7)
Using rack-mount (0.6.14)
Using rack-test (0.5.7)
Using tzinfo (0.3.35)
Using actionpack (3.0.19)
Using mime-types (1.19)

View Replies

Related to : How do I figure out why errors are occurring when running unit tests on app that is being upgraded from Rails 2.3 to Rails 3.0?

Rails unit tests: How to add my own output to unit test results
Category : Programming Languages

When running Rails unit tests I get output specifying line numbers and methods when a test fails, e.g.:

1) Failure:
[./helper/helper.rb:6:in `handle_assert'
./helper/helper.rb:17:in `check_not_string'

View Replies

Upgraded from Rails 2.3.4 to 2.3.14 and now tests are failing (Shocking, I know)
Category : Programming Languages

The problem seems to be with all tests that do POST, PUT, DELETE requests. It seems that csrf token is not being attached with those requests. Thus I get redirected to /login. It's perfectly fine with GET requests of course.

It's worth to mention that actual browser interactions are

View Replies

Simply Rails 2 - p 240-241 Unit tests
Category : Development
EDIT: This problem has been solved in Thread 635869, which I unfortunately didnt find until just now.
Original post:
When I run the unit test from pages 240 and 241 in Simply Rails 2, I get an error. The error is caused by the votes that I create in the votes fixture being in the wrong ord

View Replies

Can Rails unit tests be run on a different environment than test?
Category : Programming Languages

We have a large multi-developer project under Rails in which we are using tests for both models and controllers. Right now the developers have to switch the DB parameters for the 'test' environment to match their local dev environments before running tests. I am wondering if there is a way to run

View Replies

Helper functions in Rails unit tests
Category : Programming Languages

I'm using this sort of code in my code in my Unit tests.

test "should be awesome" do
assert true

I'm using FactoryGirl instead of fixtures.

I find that I'm repeating myself a lot and having helper functions would be quite useful. W

View Replies

Rails: How can I know which is the tested model in unit tests?
Category : Programming Languages

I have a test helper with the following signature, in test_helper.rb:

assert_resolve_mapping(model_name, attrs_ary_to_exclude = [])

The first parameter is a string representing the actual model to be asserted, i.e.: User, Customer, Invoice, e

View Replies

Pass Parameters to Rails Unit Tests
Category : Programming Languages

I was wondering if there is a way to pass arguments to individual tests in rails similar, or similar in idea, to NUnit's TestCase Attribute. Thanx

View Replies

Is it possible to debug unit tests in Ruby on Rails?
Category : Programming Languages

So, I just moved to new project that is built on Ruby on Rails. I'm new to it and I'm still learning it. I can debug most of the application code, but it seems I can not debug unit test code and code that is tested.

When I run unit testing in debug mode, I can set a breakpoint in unit

View Replies

Rails-Book: Question about 2 unit tests
Category : Development
Hello, may be somebody can tell me the reason why?
I worked myself through the Rails-book of Patrick Lenz and found every thing working well except for 2 assert-failures, for which a have no explanation.
After reinstalling Ruby, Rails, Database and Shovell-Code-Archive the 2 failures still

View Replies

DateTime Problem in Rails Unit Tests
Category : Programming Languages

I'm working on unit tests for my Rails app and have run into the following problem.

I have an Event model with a fixture that boils down to:

name: Wallflowers
start_at: <%= %>

In my unit test

View Replies

2012 / 2017 Copyrights BigHow , All Rights Reserved .