Sha256: 1df49182d7de148ed1c27d9a6bea1fe86cc32edff0eed7efd019b21e91d06555

Contents?: true

Size: 781 Bytes

Versions: 7

Compression:

Stored size: 781 Bytes

Contents

require 'spec_helper'

describe PostMailer do
  describe "#decorated_email" do
    let(:email_body) { Capybara.string(email.body.to_s) }
    let(:email) { PostMailer.decorated_email(post).deliver }
    let(:post) { Post.create }

    it "decorates" do
      expect(email_body).to have_content "Today"
    end

    it "can use url helpers with a model" do
      expect(email_body).to have_css "#url_with_model", text: "http://www.example.com:12345/en/posts/#{post.id}"
    end

    it "can use url helpers with an id" do
      expect(email_body).to have_css "#url_with_id", text: "http://www.example.com:12345/en/posts/#{post.id}"
    end

    it "uses the correct view context controller" do
      expect(email_body).to have_css "#controller", text: "PostMailer"
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
draper-4.0.2 spec/dummy/spec/mailers/post_mailer_spec.rb
draper-4.0.1 spec/dummy/spec/mailers/post_mailer_spec.rb
draper-4.0.0 spec/dummy/spec/mailers/post_mailer_spec.rb
draper-3.1.0 spec/dummy/spec/mailers/post_mailer_spec.rb
draper-3.0.1 spec/dummy/spec/mailers/post_mailer_spec.rb
draper-3.0.0 spec/dummy/spec/mailers/post_mailer_spec.rb
draper-3.0.0.pre1 spec/dummy/spec/mailers/post_mailer_spec.rb