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

Version Path
radiant-1.0.1 spec/models/user_action_observer_spec.rb
radiant-1.0.0 spec/models/user_action_observer_spec.rb
radiant-1.0.0.rc5 spec/models/user_action_observer_spec.rb
radiant-1.0.0.rc4 spec/models/user_action_observer_spec.rb
radiant-1.0.0.rc3 spec/models/user_action_observer_spec.rb
kajam-1.0.3.rc2 spec/models/user_action_observer_spec.rb
radiant-1.0.0.rc2 spec/models/user_action_observer_spec.rb
radiant-1.0.0.rc1 spec/models/user_action_observer_spec.rb
radiant-rails3-0.1 spec/models/user_action_observer_spec.rb
radiantcms-couchrest_model-0.2.4 spec/models/user_action_observer_spec.rb
radiantcms-couchrest_model-0.2.2 spec/models/user_action_observer_spec.rb
radiantcms-couchrest_model-0.2.1 spec/models/user_action_observer_spec.rb
radiantcms-couchrest_model-0.2 spec/models/user_action_observer_spec.rb
radiantcms-couchrest_model-0.1.9 spec/models/user_action_observer_spec.rb
radiantcms-couchrest_model-0.1.8 spec/models/user_action_observer_spec.rb
radiantcms-couchrest_model-0.1.7 spec/models/user_action_observer_spec.rb
radiantcms-couchrest_model-0.1.6 spec/models/user_action_observer_spec.rb
radiantcms-couchrest_model-0.1.5 spec/models/user_action_observer_spec.rb
radiantcms-couchrest_model-0.1.4 spec/models/user_action_observer_spec.rb
radiantcms-couchrest_model-0.1.3 spec/models/user_action_observer_spec.rb