Sha256: 0d2a479e81e6df245a50b3130e1d20bab9d3ecb753340dfb0747deacba6863d7
Contents?: true
Size: 776 Bytes
Versions: 32
Compression:
Stored size: 776 Bytes
Contents
require File.dirname(__FILE__) + '/../spec_helper' describe UserActionObserver do dataset :users, :pages_with_layouts, :snippets before(:each) do @user = users(:existing) UserActionObserver.current_user = @user end it 'should observe create' do [ User.create!(user_params), Page.create!(page_params), Layout.create!(layout_params), Snippet.create!(snippet_params) ].each do |model| model.created_by.should == @user end end it 'should observe update' do [ users(:existing), pages(:home), layouts(:main), snippets(:first) ].each do |model| model.attributes = model.attributes.dup model.save.should == true model.updated_by.should == @user end end end
Version data entries
32 entries across 32 versions & 5 rubygems