require 'rails_helper'

describe OwnerInitialization::Scenario1 do
  subject { build 'owner_initialization/scenario1' }
  its(:notes) { should be_blank }

  describe "with user" do
    before { User.current = build :user, email: 'user-for-notes@example.com' }

    describe '#notes=' do
      it "adds time and user info and proper notes" do
        subject.replace_notes "\n abc .\n d"
        Timecop.freeze("2016-05-20T12:34:38+03:00") { subject.notes = "alsdfj" }
        subject.notes.should eq <<-NOTE.strip_heredoc.strip
          abc .
           d

          2016-05-20T12:34:38+03:00 user-for-notes@example.com
          alsdfj
        NOTE
      end
    end
  end
end
