Sha256: 2d6a1af9031a204ee35607770d1302695b46fa6e0676bbc2d9cbd676dfad9fd7
Contents?: true
Size: 816 Bytes
Versions: 15
Compression:
Stored size: 816 Bytes
Contents
describe Pheme::MessageType::SnsMessage do module SnsMessage class Fixture < ExampleQueuePoller include Pheme::MessageType::SnsMessage end end 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(:each) do 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 'should parse the message correctly' do expect(subject.parse_body(message).test).to eq("test") end end end end
Version data entries
15 entries across 15 versions & 1 rubygems