Sha256: db19086c3aeb1d760fb6d52f188b9aa64ccf36e672dd73fb79d8fbb58f5a0738

Contents?: true

Size: 847 Bytes

Versions: 13

Compression:

Stored size: 847 Bytes

Contents

describe BeaversController do

  describe 'POST create' do
    it 'publishes a create event' do
      expect{
        post :create, beaver: { name: 'beaver' }
      }.to publish_event('user_creates_beaver', { 'beaver_name' => 'beaver' })
    end
  end

  context 'for an existing beaver' do
    let(:beaver) { Beaver.create name: 'beaver' }

    describe 'PUT update' do
      it 'publishes an update event' do
        expect{
          put :update, id: beaver.id, beaver: { name: 'beaver_updated' }
        }.to publish_event('user_updates_beaver', { 'beaver_name' => 'beaver_updated' })
      end
    end

    describe 'DELETE destroy' do
      it 'publishes an delete event' do
        expect{
          delete :destroy, id: beaver.id
        }.to publish_event('user_deletes_beaver', { 'beaver_name' => 'beaver' })
      end
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
rabbit_feed-2.4.4 example/rails_app/spec/controllers/beavers_controller_spec.rb
rabbit_feed-2.4.3 example/rails_app/spec/controllers/beavers_controller_spec.rb
rabbit_feed-2.4.2 example/rails_app/spec/controllers/beavers_controller_spec.rb
rabbit_feed-2.4.1 example/rails_app/spec/controllers/beavers_controller_spec.rb
rabbit_feed-2.4.0 example/rails_app/spec/controllers/beavers_controller_spec.rb
rabbit_feed-2.3.10 example/rails_app/spec/controllers/beavers_controller_spec.rb
rabbit_feed-2.3.9 example/rails_app/spec/controllers/beavers_controller_spec.rb
rabbit_feed-2.3.7 example/rails_app/spec/controllers/beavers_controller_spec.rb
rabbit_feed-2.3.6 example/rails_app/spec/controllers/beavers_controller_spec.rb
rabbit_feed-2.3.5 example/rails_app/spec/controllers/beavers_controller_spec.rb
rabbit_feed-2.3.4 example/rails_app/spec/controllers/beavers_controller_spec.rb
rabbit_feed-2.3.3 example/rails_app/spec/controllers/beavers_controller_spec.rb
rabbit_feed-2.3.2 example/rails_app/spec/controllers/beavers_controller_spec.rb