Skip to content

Instantly share code, notes, and snippets.

@mrchrisadams
Created July 13, 2009 14:52
Show Gist options
  • Save mrchrisadams/146179 to your computer and use it in GitHub Desktop.
Save mrchrisadams/146179 to your computer and use it in GitHub Desktop.
)
NoMethodError in 'Action notifications should notify supporters by sending email using the supporter's name'
You have a nil object when you didn't expect it!
You might have expected an instance of Array.
The error occurred while evaluating nil.include?
./spec/models/action_spec.rb:161:
Finished in 5.765043 seconds
it "should notify supporters by sending email using the supporter's name" do
@supporter.update_attribute :notify_member, true
@action.notify_new_action
(puts ActionMailer::Base.deliveries.map(&:body).flatten).should include_text(@supporter.first_name)
end
4)
'Action notifications should notify supporters by sending email using the supporter's name' FAILED
expected to find "John" in ["Hi John\n\nnag-o-meter posted something on your thought \"The world is flat\".\n\nClick below to view what they said.\n\nhttp://thenag.net/thoughts/1928\n\nYou’ll be notified when there is any activity on your thought. Click below to unsubscribe (you’ll need to log into your account).\n\nhttp://http://thenag.net/account/notifications/edit\n\nYours,\n\nThe Nag", "Hi John\n\nnag-o-meter posted something on the thought you're following \"The world is flat\".\n\nClick below to view what they said.\n\nhttp://thenag.net/thoughts/1928/actions/1169\n\nYou’ll be notified when there is any activity on your thought. Click below to unsubscribe (you’ll need to log into your account).\n\nhttp://thenag.net/account/notifications/edit\n\nYours,\n\nThe Nag"]
./spec/models/action_spec.rb:161:
it "should notify supporters by sending email using the supporter's name" do
@supporter.update_attribute :notify_member, true
@action.notify_new_action
ActionMailer::Base.deliveries.map(&:body).flatten.should include_text(@supporter.first_name)
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment