title: rspec test not passing. use of dynamic data
body: <p>I have an rspec test that was written for an email being sent. it contains a dynamic field that's filled in with the org name of the user in the application. I changed the text from one name to the other and update the spec file to reflect the difference but now it won't pass. Here's the test</p>
  
  <pre><code>require "spec_helper"
  
  describe OrgMemberMailer do
  
  context "when an invite email gets sent" do
  before(:each) do
    member = Factory(:organization_membership)
    @email = OrgMemberMailer.invite(member, 'samsdungeonsanddragonsguild.com').deliver
  end
  it "should be delivered successfully" do
    ActionMailer::Base.deliveries.should_not be_empty
    @email.from.should == ["invite@domain.com"]
    @email.subject.should == "SocialNetwork - invitation to join &lt;ORG&gt;"
    @email.encoded.should =~ /You have been invited to join &lt;ORG&gt; on SocialNetwork/
    @email.encoded.should =~ /samsdungeonsanddragonsguild.com\/organization\/accept/
  end
  
  end
  
  end
  </code></pre>
  
  <p>'SocialNetwork' is static text but  is replaced by data both in the mailer.rb and hard coded into the rspec file. I've just used  as a placeholder above.</p>
  
  <p>When I run the test, I get:</p>
  
  <pre><code>OrgMemberMailer when an invite email gets sent should be delivered successfully
       Failure/Error: @email.subject.should == "SocialNetwork - invitation to join &lt;ORG&gt;"
         expected: "SocialNetwork - invitation to join &lt;ORG&gt;"
              got: "SocialNetwork - invitation to join &lt;ORG&gt;" (using ==)
   # ./spec/org_member_mailer_spec.rb:13:in `block (3 levels) in &lt;top (required)&gt;'
  </code></pre>
  
  <p>To me, everything looks fine. I see no reason why it shouldn't pass.</p>