Sha256: 634e47c0860dcc1a536d034a2e40ff9843a65a9806ff3fde47f94be15adb940b

Contents?: true

Size: 738 Bytes

Versions: 2

Compression:

Stored size: 738 Bytes

Contents

require 'spec_helper'

describe CASino::Listener::LegacyValidator do
  let(:controller) { Object.new }
  let(:listener) { described_class.new(controller) }
  let(:response_text) { "foobar\nbla\n" }
  let(:render_parameters) { { text: response_text, content_type: 'text/plain' } }

  describe '#validation_succeeded' do
    it 'tells the controller to render the response text' do
      controller.should_receive(:render).with(render_parameters)
      listener.validation_succeeded(response_text)
    end
  end

  describe '#validation_failed' do
    it 'tells the controller to render the response text' do
      controller.should_receive(:render).with(render_parameters)
      listener.validation_failed(response_text)
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
casino-1.3.2 spec/controllers/listener/legacy_validator_spec.rb
casino-1.3.1 spec/controllers/listener/legacy_validator_spec.rb