Commit dadaac24

mo khan <mo@mokhan.ca>
2014-01-08 15:15:38
add spec for sending welcome email.
1 parent a9390b3
Changed files (1)
spec
spec/models/user_spec.rb
@@ -118,4 +118,18 @@ describe User do
       results.last.should == first_person
     end
   end
+
+  describe "send welcome email" do
+    let(:user) { build(:user) }
+    let(:mailer) { double("mailer", welcome_email: true) }
+
+    before :each do
+      UserMailer.stub(:delay).and_return(mailer)
+      user.send_welcome_email
+    end
+
+    it "should send the email" do
+      mailer.should have_received(:welcome_email).with(user)
+    end
+  end
 end