#453 √ resolved
Phil Orwig

Executing controller specs fail based on the working directory.

Reported by Phil Orwig | July 1st, 2008 @ 11:17 PM | in No-Milestone-Assigned

The helper functionality needed to test a controller is not included in specifications if the spec is run outside of the rails root.

Example:

ruby spec/controllers/main_controller_spec.rb

..

Finished in 0.177611 seconds

2 examples, 0 failures

cd spec/controllers/ ; ruby main_controller_spec.rb

FF

1)

RuntimeError in 'MainController should get :index successfully'

@controller is nil: make sure you set it in your test's setup method.

main_controller_spec.rb:8:in `get_index'

main_controller_spec.rb:12:

main_controller_spec.rb:5:

2)

RuntimeError in 'MainController should handle assigns properly'

@controller is nil: make sure you set it in your test's setup method.

main_controller_spec.rb:8:in `get_index'

main_controller_spec.rb:17:

main_controller_spec.rb:5:

Finished in 0.140009 seconds

2 examples, 2 failures

Comments and changes to this ticket

Please Login or create a free account to add a new comment.

You can update this ticket by sending an email to from your email client. (help)

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile »

Behaviour Driven Development for Ruby.

Shared Ticket Bins

People watching this ticket