<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments for Ruby Tutorials</title>
	<atom:link href="http://www.rubytutorials.net/comments/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.rubytutorials.net</link>
	<description>Doctor&#039;s orders</description>
	<lastBuildDate>Tue, 19 Jul 2011 18:09:28 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
	<item>
		<title>Comment on Small Rspec revelations, ActionMailer by concerned citizen</title>
		<link>http://www.rubytutorials.net/2008/02/26/small-rspec-revelations-actionmailer/#comment-11918</link>
		<dc:creator>concerned citizen</dc:creator>
		<pubDate>Tue, 19 Jul 2011 18:09:28 +0000</pubDate>
		<guid isPermaLink="false">http://www.rubytutorials.net/?p=11#comment-11918</guid>
		<description>why is there a partypoker link in this post? skeevy.</description>
		<content:encoded><![CDATA[<p>why is there a partypoker link in this post? skeevy.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Small Rspec revelations, ActionMailer by admin</title>
		<link>http://www.rubytutorials.net/2008/02/26/small-rspec-revelations-actionmailer/#comment-1711</link>
		<dc:creator>admin</dc:creator>
		<pubDate>Fri, 22 Jan 2010 07:37:16 +0000</pubDate>
		<guid isPermaLink="false">http://www.rubytutorials.net/?p=11#comment-1711</guid>
		<description>You have to spec a notifier (instance of ActionMailer) seperately. And it took me a long time to figure out. A spec would look something like this:

describe Notifications, :type =&gt; :helper do #setting type is necessary
  before(:each) do
    ActionMailer::Base.delivery_method = :test
    ActionMailer::Base.perform_deliveries = true
    ActionMailer::Base.deliveries = []
  end

  it &quot;should sent a nice email with the analyses to the user&quot; do
    analysis_observer = AnalysisObserver.instance
    analysis_observer.stub!(:after_create)
    mail = Notifications.deliver_analyses_to_user &quot;somegmail@gmail.com&quot;, Factory(:temporary_user, :analyses =&gt; [Factory(:analysis)])
    ActionMailer::Base.deliveries.size.should == 1
    mail.body.should have_tag(&quot;img&quot;, 3)
    mail.body.should have_tag(&quot;table&quot;)
  end

Hope that helps!</description>
		<content:encoded><![CDATA[<p>You have to spec a notifier (instance of ActionMailer) seperately. And it took me a long time to figure out. A spec would look something like this:</p>
<p>describe Notifications, :type => :helper do #setting type is necessary<br />
  before(:each) do<br />
    ActionMailer::Base.delivery_method = :test<br />
    ActionMailer::Base.perform_deliveries = true<br />
    ActionMailer::Base.deliveries = []<br />
  end</p>
<p>  it &#8220;should sent a nice email with the analyses to the user&#8221; do<br />
    analysis_observer = AnalysisObserver.instance<br />
    analysis_observer.stub!(:after_create)<br />
    mail = Notifications.deliver_analyses_to_user &#8220;somegmail@gmail.com&#8221;, Factory(:temporary_user, :analyses => [Factory(:analysis)])<br />
    ActionMailer::Base.deliveries.size.should == 1<br />
    mail.body.should have_tag(&#8220;img&#8221;, 3)<br />
    mail.body.should have_tag(&#8220;table&#8221;)<br />
  end</p>
<p>Hope that helps!</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Small Rspec revelations, ActionMailer by Amit</title>
		<link>http://www.rubytutorials.net/2008/02/26/small-rspec-revelations-actionmailer/#comment-1710</link>
		<dc:creator>Amit</dc:creator>
		<pubDate>Fri, 22 Jan 2010 06:57:53 +0000</pubDate>
		<guid isPermaLink="false">http://www.rubytutorials.net/?p=11#comment-1710</guid>
		<description>Hi i am testing email through rspec.I followed your suggestions but some problem occured.
This is the whole scenario:
What i want to do is when my user is created it should send mail to for activation.
This is the code under user_spec.rb
require File.expand_path(File.dirname(__FILE__) + &#039;/../spec_helper&#039;)
#require &#039;rasta/fixture/rasta_fixture&#039;
#require &#039;fastercsv&#039;

def valid_user_attributes
  {
    :email =&gt; &quot;testing@joshsoftware.com&quot;,
    :login =&gt; &quot;test&quot;,
    :password =&gt; &quot;test123&quot;,
    :password_confirmation =&gt; &quot;test123&quot;,
    :role_id =&gt; 1
  }
end

describe User do
  before(:each) do
    @user = User.create
    ActionMailer::Base.delivery_method = :test  
    ActionMailer::Base.perform_deliveries = true  
    ActionMailer::Base.deliveries = []  
  end

  fixtures :users

  context &quot;User&quot; do
    it &quot;should be create if all the credentials are provided&quot; do
      @user.attributes = valid_user_attributes
       mail = Notifier.signup_notification(&quot;user_1&quot;)
       ActionMailer::Base.deliveries.size.should == 1
       mail.body.should =~ /Please signup/
       @user.should be_valid
       @user.save
    end

Now here Notifier ia another model which contains signup_ notification method.
Is it the case that i would need to test that in notifier spec or is it possible to get notifier model in user like require &#039;notifier.rb&#039;
Please suggest</description>
		<content:encoded><![CDATA[<p>Hi i am testing email through rspec.I followed your suggestions but some problem occured.<br />
This is the whole scenario:<br />
What i want to do is when my user is created it should send mail to for activation.<br />
This is the code under user_spec.rb<br />
require File.expand_path(File.dirname(__FILE__) + &#8216;/../spec_helper&#8217;)<br />
#require &#8216;rasta/fixture/rasta_fixture&#8217;<br />
#require &#8216;fastercsv&#8217;</p>
<p>def valid_user_attributes<br />
  {<br />
    :email =&gt; &#8220;testing@joshsoftware.com&#8221;,<br />
    :login =&gt; &#8220;test&#8221;,<br />
    :password =&gt; &#8220;test123&#8243;,<br />
    :password_confirmation =&gt; &#8220;test123&#8243;,<br />
    :role_id =&gt; 1<br />
  }<br />
end</p>
<p>describe User do<br />
  before(:each) do<br />
    @user = User.create<br />
    ActionMailer::Base.delivery_method = :test<br />
    ActionMailer::Base.perform_deliveries = true<br />
    ActionMailer::Base.deliveries = []<br />
  end</p>
<p>  fixtures :users</p>
<p>  context &#8220;User&#8221; do<br />
    it &#8220;should be create if all the credentials are provided&#8221; do<br />
      @user.attributes = valid_user_attributes<br />
       mail = Notifier.signup_notification(&#8220;user_1&#8243;)<br />
       ActionMailer::Base.deliveries.size.should == 1<br />
       mail.body.should =~ /Please signup/<br />
       @user.should be_valid<br />
       @user.save<br />
    end</p>
<p>Now here Notifier ia another model which contains signup_ notification method.<br />
Is it the case that i would need to test that in notifier spec or is it possible to get notifier model in user like require &#8216;notifier.rb&#8217;<br />
Please suggest</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Small Rspec revelations, ActionMailer by ahabman</title>
		<link>http://www.rubytutorials.net/2008/02/26/small-rspec-revelations-actionmailer/#comment-1361</link>
		<dc:creator>ahabman</dc:creator>
		<pubDate>Tue, 24 Nov 2009 17:48:37 +0000</pubDate>
		<guid isPermaLink="false">http://www.rubytutorials.net/?p=11#comment-1361</guid>
		<description>Perfect.  That&#039;s exactly what I needed.</description>
		<content:encoded><![CDATA[<p>Perfect.  That&#8217;s exactly what I needed.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Small Rspec revelations, ActionMailer by Simple Email Form with ActionMailer</title>
		<link>http://www.rubytutorials.net/2008/02/26/small-rspec-revelations-actionmailer/#comment-1293</link>
		<dc:creator>Simple Email Form with ActionMailer</dc:creator>
		<pubDate>Wed, 18 Nov 2009 06:33:04 +0000</pubDate>
		<guid isPermaLink="false">http://www.rubytutorials.net/?p=11#comment-1293</guid>
		<description>[...] In test-driven style (thanks to rubytutorials.net), here&#8217;s a spec for we&#8217;ll make work (at least the sending mail part of it). Note that [...]</description>
		<content:encoded><![CDATA[<p>[...] In test-driven style (thanks to rubytutorials.net), here&#8217;s a spec for we&#8217;ll make work (at least the sending mail part of it). Note that [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Small Rspec revelations, ActionMailer by Marcelo Silveira</title>
		<link>http://www.rubytutorials.net/2008/02/26/small-rspec-revelations-actionmailer/#comment-1206</link>
		<dc:creator>Marcelo Silveira</dc:creator>
		<pubDate>Thu, 29 Oct 2009 19:51:49 +0000</pubDate>
		<guid isPermaLink="false">http://www.rubytutorials.net/?p=11#comment-1206</guid>
		<description>Helped a lot. Thanks!</description>
		<content:encoded><![CDATA[<p>Helped a lot. Thanks!</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Glassfish v3 with Merb and Warbler by LOTD #15: Deploying Merb application on GlassFish v3 using Warbler &#171; Miles to go &#8230;</title>
		<link>http://www.rubytutorials.net/2008/12/03/glassfish-v3-with-merb-and-warbler/#comment-1008</link>
		<dc:creator>LOTD #15: Deploying Merb application on GlassFish v3 using Warbler &#171; Miles to go &#8230;</dc:creator>
		<pubDate>Fri, 21 Aug 2009 23:14:52 +0000</pubDate>
		<guid isPermaLink="false">http://www.rubytutorials.net/?p=20#comment-1008</guid>
		<description>[...] GlassFish v3 with Merb and Warbler explains how to use Warbler to deploy a Merb application on GlassFish v3. Here is a quote&#160;from the blog: [...]</description>
		<content:encoded><![CDATA[<p>[...] GlassFish v3 with Merb and Warbler explains how to use Warbler to deploy a Merb application on GlassFish v3. Here is a quote&nbsp;from the blog: [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on The usage of self in Ruby by John conrad</title>
		<link>http://www.rubytutorials.net/2008/01/01/the-usage-of-self-in-ruby/#comment-907</link>
		<dc:creator>John conrad</dc:creator>
		<pubDate>Sun, 12 Jul 2009 09:53:49 +0000</pubDate>
		<guid isPermaLink="false">http://www.rubytutorials.net/?p=9#comment-907</guid>
		<description>one more nice topic in your blog and nice comments too keep it up, If you advise some more related links to topic. I&#039;m very interested in CMS and all its related subjects.</description>
		<content:encoded><![CDATA[<p>one more nice topic in your blog and nice comments too keep it up, If you advise some more related links to topic. I&#8217;m very interested in CMS and all its related subjects.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Deploying a Merb app on Glassfish with Capistrano by Anh</title>
		<link>http://www.rubytutorials.net/2008/12/04/deploying-a-merb-app-on-glassfish-with-capistrano/#comment-863</link>
		<dc:creator>Anh</dc:creator>
		<pubDate>Tue, 23 Jun 2009 06:28:25 +0000</pubDate>
		<guid isPermaLink="false">http://www.rubytutorials.net/?p=21#comment-863</guid>
		<description>Thank you !!!</description>
		<content:encoded><![CDATA[<p>Thank you !!!</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on attachment_fu dances with Capistrano by admin</title>
		<link>http://www.rubytutorials.net/2007/11/13/attachment_fu-dances-with-capistrano/#comment-823</link>
		<dc:creator>admin</dc:creator>
		<pubDate>Thu, 04 Jun 2009 11:26:56 +0000</pubDate>
		<guid isPermaLink="false">http://www.rubytutorials.net/?p=5#comment-823</guid>
		<description>Just run that command on the commandline and you&#039;re done!</description>
		<content:encoded><![CDATA[<p>Just run that command on the commandline and you&#8217;re done!</p>
]]></content:encoded>
	</item>
</channel>
</rss>

