Sha256: 2e2ac64c566afed014e33ea0379b5504e3f970926462aab2ceaf5a718cd32052

Contents?: true

Size: 1.08 KB

Versions: 1

Compression:

Stored size: 1.08 KB

Contents

describe ActivityNotification::ActsAsNotifiable do
  let(:dummy_model_class) { Dummy::DummyBase }

  describe "as public class methods" do
    describe ".acts_as_notifiable" do
      it "have not included Notifiable before calling" do
        expect(dummy_model_class.respond_to?(:available_as_notifiable?)).to be_falsey
      end

      it "includes Notifiable" do
        dummy_model_class.acts_as_notifiable :users
        expect(dummy_model_class.respond_to?(:available_as_notifiable?)).to be_truthy
        expect(dummy_model_class.available_as_notifiable?).to be_truthy
      end

      context "with no options" do
        it "returns hash of specified options" do
          expect(dummy_model_class.acts_as_notifiable :users).to eq({})
        end
      end

      #TODO test other options
    end

    describe ".available_notifiable_options" do
      it "returns list of available options in acts_as_notifiable" do
        expect(dummy_model_class.available_notifiable_options)
          .to eq([:targets, :group, :notifier, :parameters, :email_allowed, :notifiable_path])
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
activity_notification-0.0.10 spec/roles/acts_as_notifiable_spec.rb