On Sat, Jun 12, 2010 at 7:01 AM, David Chelimsky <dchelim...@gmail.com> wrote:
> On Fri, Jun 11, 2010 at 2:22 PM, Peter Fitzgibbons
> <peter.fitzgibb...@gmail.com> wrote:
>> This came out of the mailer generator w/ Rspec-rails installed :
>>
>> describe Notifier do
>>   it "should deliver activation instructions message" do
>>     @expected.subject = "Activation instructions"
>>     @expected.to      = "t...@example.org"
>>     @expected.from    = "f...@example.com"
>>     @expected.body    = read_fixture("activation_instructions")
>>   end
>>
>>
>> Could someone tell me how to modify this spec so that an argument can be
>> sent into Notifier#activation_instructions ?
>>
>> class Notfier < ActionMailer::Base
>>     def activation_instructions(user)
>>         # ... mail :to => ...
>>     end
>> end
>
> user = stub_model(User)
> @expected.activation_instructions(user)
>
> I'm adding a mailer() method to wrap @expected for the next release,
> but it's the same object.

Disregard :)

I'll add a mailer method that access the mailer, and a message method
that wraps @expected.
_______________________________________________
rspec-users mailing list
rspec-users@rubyforge.org
http://rubyforge.org/mailman/listinfo/rspec-users

Reply via email to