Forum: Ruby on Rails Accessing routes from tests

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
David T. (Guest)
on 2008-11-03 15:15
Inspired by Railscasts #124 "Beta Invitations"
( I created a small
invitation system. The episode doesn't cover testing, so I've made some
tests for the Mailer responsible for sending the invitations. The test
looks like this:

def test_invitation
  invitation = Invitation.create(:sender => users(:admin),
:recipient_email => "removed_email_address@domain.invalid")
  signup_url = "???"
  mail = InvitationMailer.create_invitation(invitation, signup_url)
  assert_equal "Invitation: Join Fountain CMS site", mail.subject
  assert_equal invitation.recipient_email,
  assert_equal "removed_email_address@domain.invalid", mail.from.first
  expected_body = "You were invited to join Fountain CMS
  assert_equal expected_body, mail.body

The test passes but as you can see, the local variable "signup_url" is
set to "???". That basically means that I don't know how to access my
routes outside the controllers and views. How is that done?
This topic is locked and can not be replied to.