Sha256: 1947cf1785bf58ea041d0507584806d24c94bb2ca54e124cdf8ef782f16b4dcf

Contents?: true

Size: 907 Bytes

Versions: 4

Compression:

Stored size: 907 Bytes

Contents

RSpec.describe Aldous::Respondable::SendData do
  class Aldous::Respondable::SendData::Dummy < described_class
    def data
      'hello'
    end

    def options
      'world'
    end
  end

  subject(:send_data) {Aldous::Respondable::SendData::Dummy.new(status, view_data, view_context)}

  let(:status) {:foo}
  let(:view_data) {double("view_data")}
  let(:view_context) {double("view context")}

  describe "::action" do
    let(:controller) {double("controller")}

    it "returns a send_data response action object" do
      expect(send_data.action(controller)).to be_kind_of Aldous::Respondable::SendData::SendDataAction
    end

    it 'creates a send_data response action with the relevant parameters' do
      expect(Aldous::Respondable::SendData::SendDataAction).to receive(:new).with(send_data.data, send_data.options, controller, view_data)
      send_data.action(controller)
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
aldous-1.1.3 spec/aldous/respondable/send_data_spec.rb
aldous-1.1.2 spec/aldous/respondable/send_data_spec.rb
aldous-1.0.1 spec/aldous/respondable/send_data_spec.rb
aldous-1.0.0 spec/aldous/respondable/send_data_spec.rb