Jaimin Pandya
2014-Jun-03 17:01 UTC
How to solve NameError: undefined local variable or method `user'
I am using Ruby 1.9.3 and Rails 3.2.16. When I run test suite: bundle exec rspec spec/ I get following error: 1) Authentication authorization in the Users controller visiting the following page Failure/Error: before { visit following_user_path(user) } NameError: undefined local variable or method `user' for #<RSpec::Core::ExampleGroup::Nested_7::Nested_3::Nested_3::Nested_2:0x00000006402418> # ./spec/requests/authentication_pages_spec.rb:93:in `block (5 levels) in <top (required)>' 2) Authentication authorization in the Users controller visiting the followers page Failure/Error: before { visit followers_user_path(user) } NameError: undefined local variable or method `user' for #<RSpec::Core::ExampleGroup::Nested_7::Nested_3::Nested_3::Nested_3:0x0000000640c2b0> # ./spec/requests/authentication_pages_spec.rb:98:in `block (5 levels) in <top (required)>' I attach authentication_pages_spec.rb file. Please find it. How can I solve this error? Kind regards. Attachments: http://www.ruby-forum.com/attachment/9766/authentication_pages_spec.rb -- Posted via http://www.ruby-forum.com/. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/84116d65a1e1a910475ba54be20539bd%40ruby-forum.com. For more options, visit https://groups.google.com/d/optout.