Sha256: eb7f664d4a4490f8f4c0e6ff19a890f1e6301151719f8a2c2fd62f2527bee655

Contents?: true

Size: 973 Bytes

Versions: 10

Compression:

Stored size: 973 Bytes

Contents

# -*- coding: utf-8 -*-
require File.dirname(__FILE__) + '/../spec_helper'

describe NormalMailer do
  include Jpmobile::Util

  before(:each) do
    ActionMailer::Base.deliveries = []

    @to      = ["outer@jp.mobile", "outer1@jp.mobile"]
    @subject = "日本語題名"
    @text    = "日本語テキスト"
  end

  context "PC宛メール" do
    it "正常に送信できること" do
      email = NormalMailer.msg(@to, "題名", "本文").deliver

      ActionMailer::Base.deliveries.size.should == 1
      (email.to - @to).should be_empty
    end

    it "UTF-8のままであること" do
      email = NormalMailer.msg(@to, @subject, @text).deliver

      ActionMailer::Base.deliveries.size.should == 1

      raw_mail = ascii_8bit(email.to_s)
      raw_mail.should match(/UTF-8/i)
      raw_mail.should match(Regexp.escape("=E6=97=A5=E6=9C=AC=E8=AA=9E=E9=A1=8C=E5=90=8D"))
      raw_mail.should match(Regexp.escape([@text].pack("m").strip))
    end
  end
end

Version data entries

10 entries across 5 versions & 1 rubygems

Version Path
jpmobile-1.0.0.pre.4 test/rails/rails_root/spec/models/normal_mailer_spec.rb
jpmobile-1.0.0.pre.4 test/rails/overrides/spec/models/normal_mailer_spec.rb
jpmobile-1.0.0.pre.3 test/rails/overrides/spec/models/normal_mailer_spec.rb
jpmobile-1.0.0.pre.3 test/rails/rails_root/spec/models/normal_mailer_spec.rb
jpmobile-1.0.0.pre.2 test/rails/overrides/spec/models/normal_mailer_spec.rb
jpmobile-1.0.0.pre.2 test/rails/rails_root/spec/models/normal_mailer_spec.rb
jpmobile-1.0.0.pre.1 test/rails/rails_root/spec/models/normal_mailer_spec.rb
jpmobile-1.0.0.pre.1 test/rails/overrides/spec/models/normal_mailer_spec.rb
jpmobile-1.0.0.pre test/rails/rails_root/spec/models/normal_mailer_spec.rb
jpmobile-1.0.0.pre test/rails/overrides/spec/models/normal_mailer_spec.rb