I'm testing my authentication to make sure that the page is being
loaded when I'm authenticated. My cucumber tests, however, are
returning this:
You have a nil object when you didn't expect it!
The error occurred while evaluating nil.sorting (NoMethodError)
/Users/administrator/Documents/Rails Projects/lms/vendor/plugins/
active_scaffold/lib/active_scaffold/actions/list.rb:55:in `do_list'
/Users/administrator/Documents/Rails Projects/lms/vendor/plugins/
active_scaffold/lib/active_scaffold/actions/list.rb:33:in `list'
/Users/administrator/Documents/Rails Projects/lms/vendor/plugins/
active_scaffold/lib/active_scaffold/actions/list.rb:8:in `index'
/Library/Ruby/Gems/1.8/gems/actionpack-2.2.2/lib/
action_controller/base.rb:1253:in `send'
/Library/Ruby/Gems/1.8/gems/actionpack-2.2.2/lib/
action_controller/base.rb:1253:in `perform_action_without_filters'
/Library/Ruby/Gems/1.8/gems/actionpack-2.2.2/lib/
action_controller/filters.rb:617:in `call_filters'
/Library/Ruby/Gems/1.8/gems/actionpack-2.2.2/lib/
action_controller/filters.rb:610:in `perform_action_without_benchmark'
/Library/Ruby/Gems/1.8/gems/actionpack-2.2.2/lib/
action_controller/benchmarking.rb:68:in
`perform_action_without_rescue'
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/
ruby/1.8/benchmark.rb:293:in `measure'
/Library/Ruby/Gems/1.8/gems/actionpack-2.2.2/lib/
action_controller/benchmarking.rb:68:in
`perform_action_without_rescue'
/Library/Ruby/Gems/1.8/gems/actionpack-2.2.2/lib/
action_controller/rescue.rb:136:in `perform_action_without_caching'
/Library/Ruby/Gems/1.8/gems/actionpack-2.2.2/lib/
action_controller/caching/sql_cache.rb:13:in `perform_action'
/Library/Ruby/Gems/1.8/gems/activerecord-2.2.2/lib/active_record/
connection_adapters/abstract/query_cache.rb:34:in `cache'
/Library/Ruby/Gems/1.8/gems/activerecord-2.2.2/lib/active_record/
query_cache.rb:8:in `cache'
/Library/Ruby/Gems/1.8/gems/actionpack-2.2.2/lib/
action_controller/caching/sql_cache.rb:12:in `perform_action'
/Library/Ruby/Gems/1.8/gems/actionpack-2.2.2/lib/
action_controller/base.rb:524:in `send'
/Library/Ruby/Gems/1.8/gems/actionpack-2.2.2/lib/
action_controller/base.rb:524:in `process_without_filters'
/Library/Ruby/Gems/1.8/gems/actionpack-2.2.2/lib/
action_controller/filters.rb:606:in
`process_without_session_management_support'
/Library/Ruby/Gems/1.8/gems/actionpack-2.2.2/lib/
action_controller/session_management.rb:134:in `process_without_test'
/Library/Ruby/Gems/1.8/gems/actionpack-2.2.2/lib/
action_controller/test_process.rb:18:in `process'
/Library/Ruby/Gems/1.8/gems/actionpack-2.2.2/lib/
action_controller/base.rb:392:in `process'
/Library/Ruby/Gems/1.8/gems/actionpack-2.2.2/lib/
action_controller/dispatcher.rb:183:in `handle_request'
/Library/Ruby/Gems/1.8/gems/actionpack-2.2.2/lib/
action_controller/dispatcher.rb:110:in `dispatch_unlocked'
/Library/Ruby/Gems/1.8/gems/actionpack-2.2.2/lib/
action_controller/dispatcher.rb:123:in `dispatch'
/Library/Ruby/Gems/1.8/gems/actionpack-2.2.2/lib/
action_controller/dispatcher.rb:122:in `synchronize'
/Library/Ruby/Gems/1.8/gems/actionpack-2.2.2/lib/
action_controller/dispatcher.rb:122:in `dispatch'
/Library/Ruby/Gems/1.8/gems/actionpack-2.2.2/lib/
action_controller/dispatcher.rb:141:in `call'
/Library/Ruby/Gems/1.8/gems/actionpack-2.2.2/lib/
action_controller/integration.rb:279:in `process'
/Library/Ruby/Gems/1.8/gems/actionpack-2.2.2/lib/
action_controller/integration.rb:185:in `get'
/Library/Ruby/Gems/1.8/gems/actionpack-2.2.2/lib/
action_controller/integration.rb:447:in `__send__'
/Library/Ruby/Gems/1.8/gems/actionpack-2.2.2/lib/
action_controller/integration.rb:447:in `get'
/Library/Ruby/Gems/1.8/gems/webrat-0.4.2/lib/webrat/rails.rb:
70:in `send'
/Library/Ruby/Gems/1.8/gems/webrat-0.4.2/lib/webrat/rails.rb:
70:in `do_request'
/Library/Ruby/Gems/1.8/gems/webrat-0.4.2/lib/webrat/rails.rb:
35:in `get'
/Library/Ruby/Gems/1.8/gems/webrat-0.4.2/lib/webrat/core/
session.rb:104:in `send'
/Library/Ruby/Gems/1.8/gems/webrat-0.4.2/lib/webrat/core/
session.rb:104:in `request_page'
/Library/Ruby/Gems/1.8/gems/webrat-0.4.2/lib/webrat/core/
session.rb:205:in `visit'
(eval):2:in `visit'
./features/step_definitions/webrat_steps.rb:7:in `When /^I go to
(.+)$/'
features/authentication.feature:16:in `When I go to the users
page'
It works in development, but not in test. Here are my test steps:
Given /^I am logged in with rights to see the users page$/ do
@user = User.create!(:full_name => "Joe User", :password =>
"password", :password_confirmation => "password",
:email_address => "[email protected]", :company => "Joes Co.", :username
=> "joe")
@user.roles << Role.create!(:name => "Admin")
@user.roles[0].menu_items << MenuItem.create!(:name => "Users", :url
=> "/users")
UserSession.new(:username => @user.username, :password =>
@user.password)
end
I use the webrat step to go to the user page. So, it just makes a GET
request to the page. If it's a data definition problem, can someone
tell me what's wrong? The only user in the system is the one defined
above.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"ActiveScaffold : Ruby on Rails plugin" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/activescaffold?hl=en
-~----------~----~----~----~------~----~------~--~---