File: welcome_controller_spec.rb

package info (click to toggle)
ruby-email-spec 2.2.0-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, forky, sid, trixie
  • size: 980 kB
  • sloc: ruby: 2,420; makefile: 3
file content (20 lines) | stat: -rw-r--r-- 715 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
require File.expand_path(File.dirname(__FILE__) + '/../spec_helper')

describe WelcomeController, :type => :controller do

  describe "POST /signup (#signup)" do
    it "should deliver the signup email" do
      expect {
        post :signup, "Email" => "email@example.com", "Name" => "Jimmy Bean"
      }.to change(ActionMailer::Base.deliveries, :size).by(1)

      last_delivery = ActionMailer::Base.deliveries.last
      expect(last_delivery.to).to include "email@example.com"
      #message is now multipart, make sure both parts include Jimmy Bean
      expect(last_delivery.parts[0].body.to_s).to include "Jimmy Bean"
      expect(last_delivery.parts[1].body.to_s).to include "Jimmy Bean"
    end

  end

end