Sha256: 16dbbc0a1cb8298676003d6c2aa3e949d44c05ac5b39a4f31e63b0e9af1f1448

Contents?: true

Size: 807 Bytes

Versions: 17

Compression:

Stored size: 807 Bytes

Contents

require "spec_helper"
require 'mail'

module GhostInThePost
  describe GhostOnCommand do
    let(:instance) { SomeMailer.new(Mail.new(to: "foo@example.com", from: "me@example.com")) }
    let(:email) {instance.mail}

    describe "#ghost" do
      it "Should return a Message" do
        expect(email.ghost).to be_a(Mail::Message)
      end
      it "should create a MailGhost" do
        email.included_scripts = ["test"]
        email.ghost_timeout = 1000
        email.ghost_wait_event = "test"
        expect(MailGhost).to receive(:new).with(email, 1000, "test", ["test"]).and_call_original
        email.ghost
      end
      it "should apply included scripts to the mail ghost" do
        expect(email).to receive(:included_scripts).and_call_original
        email.ghost
      end
    end

  end
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
ghost_in_the_post-0.1.4 spec/lib/ghost_in_the_post/ghost_on_command_spec.rb
ghost_in_the_post-0.1.3 spec/lib/ghost_in_the_post/ghost_on_command_spec.rb
ghost_in_the_post-0.1.2 spec/lib/ghost_in_the_post/ghost_on_command_spec.rb
ghost_in_the_post-0.1.0 spec/lib/ghost_in_the_post/ghost_on_command_spec.rb
ghost_in_the_post-0.0.14 spec/lib/ghost_in_the_post/ghost_on_command_spec.rb
ghost_in_the_post-0.0.13 spec/lib/ghost_in_the_post/ghost_on_command_spec.rb
ghost_in_the_post-0.0.12 spec/lib/ghost_in_the_post/ghost_on_command_spec.rb
ghost_in_the_post-0.0.11 spec/lib/ghost_in_the_post/ghost_on_command_spec.rb
ghost_in_the_post-0.0.10 spec/lib/ghost_in_the_post/ghost_on_command_spec.rb
ghost_in_the_post-0.0.9 spec/lib/ghost_in_the_post/ghost_on_command_spec.rb
ghost_in_the_post-0.0.8 spec/lib/ghost_in_the_post/ghost_on_command_spec.rb
ghost_in_the_post-0.0.7 spec/lib/ghost_in_the_post/ghost_on_command_spec.rb
ghost_in_the_post-0.0.6 spec/lib/ghost_in_the_post/ghost_on_command_spec.rb
ghost_in_the_post-0.0.5 spec/lib/ghost_in_the_post/ghost_on_command_spec.rb
ghost_in_the_post-0.0.4 spec/lib/ghost_in_the_post/ghost_on_command_spec.rb
ghost_in_the_post-0.0.3 spec/lib/ghost_in_the_post/ghost_on_command_spec.rb
ghost_in_the_post-0.0.2 spec/lib/ghost_in_the_post/ghost_on_command_spec.rb