Sha256: 731231738b1b3ef9c7b61be9cdb77a01baf837db8a97595e53098b24c2fdbe10
Contents?: true
Size: 839 Bytes
Versions: 20
Compression:
Stored size: 839 Bytes
Contents
describe Pheme::MessageType::SnsMessage do subject { SnsMessage::Fixture.new } let(:poller) do poller = double allow(poller).to receive(:poll).with(kind_of(Hash)) allow(poller).to receive(:parse_message) allow(poller).to receive(:before_request) poller end before do test_class = Class.new(ExampleQueuePoller) do include Pheme::MessageType::SnsMessage end stub_const('SnsMessage::Fixture', test_class) use_default_configuration! allow(Aws::SQS::QueuePoller).to receive(:new) { poller } end describe "#parse_message" do context "with JSON message" do let!(:message) { OpenStruct.new({ body: '{"Message":"{\"test\":\"test\"}"}' }) } it 'parses the message correctly' do expect(subject.parse_body(message).test).to eq("test") end end end end
Version data entries
20 entries across 20 versions & 1 rubygems