Sha256: da021b77e772d96a84817dc583048c31381347f46852ea6854c95bcdde3e5aa2

Contents?: true

Size: 789 Bytes

Versions: 3

Compression:

Stored size: 789 Bytes

Contents

require 'spec_helper'

describe Controll::Notify::Message::Handler do
  subject { Controll::Notify::Message::Handler.new message }

  let(:message)    { Controll::Notify::Message.new text, options  }
  let(:text)       { 'Error while authenticating via {{full_route}}. The service returned invalid data for the user id.' }
  let(:options) do
    {:full_route => 'the_path'}
  end

  describe '.initialize message' do
    its(:message) { should == message } 
  end

  describe '.handle' do
    context 'simple text' do
      let(:text)       { 'simple text' }

      its(:handle) { should == text }
    end

    context 'with arg replacement' do
      its(:handle) { should == 'Error while authenticating via the_path. The service returned invalid data for the user id.' }
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
controll-0.3.2 spec/controll/notify/message/handler_spec.rb
controll-0.3.1 spec/controll/notify/message/handler_spec.rb
controll-0.3.0 spec/controll/notify/message/handler_spec.rb