Sha256: 661f197fd7aeb19e08af52b1f7dfe677e5ab07e2fbadcf70c020cf9c6521e999

Contents?: true

Size: 1.17 KB

Versions: 9

Compression:

Stored size: 1.17 KB

Contents

require 'activity_notification/optional_targets/action_cable_api_channel'
describe ActivityNotification::OptionalTarget::ActionCableApiChannel do
  let(:test_instance) { ActivityNotification::OptionalTarget::ActionCableApiChannel.new(skip_initializing_target: true) }

  describe "as public instance methods" do
    describe "#to_optional_target_name" do
      it "is return demodulized symbol class name" do
        expect(test_instance.to_optional_target_name).to eq(:action_cable_api_channel)
      end
    end

    describe "#initialize_target" do
      it "does not raise NotImplementedError" do
        test_instance.initialize_target
      end
    end

    describe "#notify" do
      it "does not raise NotImplementedError" do
        test_instance.notify(create(:notification))
      end
    end
  end

  describe "as protected instance methods" do
    describe "#render_notification_message" do
      context "as default" do
        it "renders notification message as formatted JSON" do
          expect(test_instance.send(:render_notification_message, create(:notification)).with_indifferent_access[:notification].has_key?(:id)).to be_truthy
        end
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
activity_notification-2.3.3 spec/optional_targets/action_cable_api_channel_spec.rb
activity_notification-2.3.2 spec/optional_targets/action_cable_api_channel_spec.rb
activity_notification-2.3.1 spec/optional_targets/action_cable_api_channel_spec.rb
activity_notification-2.3.0 spec/optional_targets/action_cable_api_channel_spec.rb
activity_notification-2.2.4 spec/optional_targets/action_cable_api_channel_spec.rb
activity_notification-2.2.3 spec/optional_targets/action_cable_api_channel_spec.rb
activity_notification-2.2.2 spec/optional_targets/action_cable_api_channel_spec.rb
activity_notification-2.2.1 spec/optional_targets/action_cable_api_channel_spec.rb
activity_notification-2.2.0 spec/optional_targets/action_cable_api_channel_spec.rb