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