Sha256: ca4c6fb91837f29d080ec8c9e687c6c4bf18a3588b41cc0d513917cb9e6d4dff

Contents?: true

Size: 895 Bytes

Versions: 4

Compression:

Stored size: 895 Bytes

Contents

RSpec.describe Aldous::Respondable::Redirectable do
  class Aldous::Respondable::Redirectable::Dummy < described_class
    def location
      'hello'
    end
  end

  subject(:redirectable) {Aldous::Respondable::Redirectable::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 redirect response action object" do
      expect(redirectable.action(controller)).to be_kind_of Aldous::Respondable::Redirectable::RedirectAction
    end

    it 'creates a redirect response action with the relevant parameters' do
      expect(Aldous::Respondable::Redirectable::RedirectAction).to receive(:new).with(redirectable.location, controller, view_data, status)
      redirectable.action(controller)
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

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