title: Rspec assigning local variable?
body: <p>Just wondering if there's a way to access local variables in rspec without turning them into instance variables? To explain my issue:</p>
  
  <p>I have the following action:</p>
  
  <pre><code>  def queue_due_mail
      payments = Payment.due_soon.where(:send_reminder =&gt; true)
      payments.each do |p|
        PaymentMailer.delay.reminder_email(p)
        p.send_reminder = false
        p.save
      end
      redirect_to root_path
    end
  </code></pre>
  
  <p>And, in my spec, I want to run something like this:</p>
  
  <pre><code>it "should assign nearly due payments to payments" do
    Payment.stub_chain(:due_soon, :where) { [mock_payment] }
    get :queue_due_mail
    assigns[:payments].should eq([mock_payment])
  end
  </code></pre>
  
  <p>The problem is that the assigns[:payments] call only works if I turn the local variable 'payments' into '@payments'. This isn't a major problem, but I'd rather not have my rspec tests influence by actual code.</p>
  
  <p>So, is there a way to reference local variables in rspec assigns?</p>
  
  <p>Cheers...</p>