Sha256: 3cf1b530189c03b8c0c8b347423dd16addba0cbbd2af18a7548da52c56de3aaf

Contents?: true

Size: 651 Bytes

Versions: 25

Compression:

Stored size: 651 Bytes

Contents

require "spec_helper"

RSpec.describe CanvasSync::Concerns::LiveEventSync do
  before(:all) do
    User.include(CanvasSync::Concerns::LiveEventSync)
  end

  let(:event) {
    {
      "metadata" => {
        event_name: "user_created",
      },
      "payload" => {
        user_id: 124,
      },
    }
  }

  describe "#perform" do
    it "determines ID from payload" do
      expect_any_instance_of(User).to receive(:process_live_event).with(:created, event["payload"], event["metadata"]) do |user, *args|
        expect(user.canvas_id).to eql 124
      end
      User.cs_internal_process_live_event(event.with_indifferent_access)
    end
  end
end

Version data entries

25 entries across 25 versions & 1 rubygems

Version Path
canvas_sync-0.22.9 spec/canvas_sync/live_events/live_event_sync_spec.rb
canvas_sync-0.22.8 spec/canvas_sync/live_events/live_event_sync_spec.rb
canvas_sync-0.22.6 spec/canvas_sync/live_events/live_event_sync_spec.rb
canvas_sync-0.22.5 spec/canvas_sync/live_events/live_event_sync_spec.rb
canvas_sync-0.22.4 spec/canvas_sync/live_events/live_event_sync_spec.rb
canvas_sync-0.22.3 spec/canvas_sync/live_events/live_event_sync_spec.rb
canvas_sync-0.22.2 spec/canvas_sync/live_events/live_event_sync_spec.rb
canvas_sync-0.22.1 spec/canvas_sync/live_events/live_event_sync_spec.rb
canvas_sync-0.22.0 spec/canvas_sync/live_events/live_event_sync_spec.rb
canvas_sync-0.22.0.beta8 spec/canvas_sync/live_events/live_event_sync_spec.rb
canvas_sync-0.22.0.beta7 spec/canvas_sync/live_events/live_event_sync_spec.rb
canvas_sync-0.22.0.beta6 spec/canvas_sync/live_events/live_event_sync_spec.rb
canvas_sync-0.22.0.beta5 spec/canvas_sync/live_events/live_event_sync_spec.rb
canvas_sync-0.22.0.beta4 spec/canvas_sync/live_events/live_event_sync_spec.rb
canvas_sync-0.22.0.beta3 spec/canvas_sync/live_events/live_event_sync_spec.rb
canvas_sync-0.22.0.beta2 spec/canvas_sync/live_events/live_event_sync_spec.rb
canvas_sync-0.22.0.beta1 spec/canvas_sync/live_events/live_event_sync_spec.rb
canvas_sync-0.21.1 spec/canvas_sync/live_events/live_event_sync_spec.rb
canvas_sync-0.21.1.beta1 spec/canvas_sync/live_events/live_event_sync_spec.rb
canvas_sync-0.21.0 spec/canvas_sync/live_events/live_event_sync_spec.rb