http://ruby.railstutorial.org/chapters/following-users?version=3.2
There is a test for User model
it { should respond_to(:reverse_relationships) }
fails:
Failures:
1) User
←[31mFailure/Error:←[0m ←[31mit { should respond_to(:reverse_relationships) }←[0m
←[31mNoMethodError:←[0m
←[31mundefined methodit' for #<RSpec::Core::ExampleGroup::Nested_3:0x32 6c310>←[0m ←[36m # ./spec/models/user_spec.rb:36:inblock (2 levels) in ‘←[0mFinished in 23 seconds ←[31m131 examples, 1 failure←[0m
Failed examples:
←[31mrspec ./spec/models/user_spec.rb:35←[0m ←[36m# User ←[0m
At the same time, in rails console –sandbox it looks quite ok:
irb(main):014:0> user.respond_to?(:reverse_relationships)
=> true
How can it be?
The stack trace shows that the error is that the method “it” is undefined in the current context.
It is because you are missing a right brace on line 22 and have two right braces at line 24.