require "rails_helper"

RSpec.describe OwnerMailer, type: :mailer do
  describe "owner_initialization_finished" do
    let(:batch) { build 'workflow_instance_batch/scenario1' }
    let(:workflow_step) { build 'owner_initialization/scenario1' }
    let(:mail) { OwnerMailer.owner_initialization_finished batch, workflow_step}

    it "renders the headers" do
      expect(mail.subject).to eq("Owner initialization finished")
      expect(mail.to).to eq(["to@example.org"])
      expect(mail.from).to eq(["from@example.com"])
    end

    it "renders the body" do
      expect(mail.body.encoded).to match("Hi")
    end
  end

end
