Sha256: a4282ab0d5417a000c2ba14446c62b3cc2e828b2678391388026aa62aef182fd

Contents?: true

Size: 609 Bytes

Versions: 12

Compression:

Stored size: 609 Bytes

Contents

require File.expand_path(File.dirname(__FILE__) + '/../snippets_spec_helper.rb')

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
    snippet = Snippet.create!(snippet_params)
    snippet.created_by.should == @user
  end
  
  it 'should observe update' do
    [
      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

12 entries across 12 versions & 2 rubygems

Version Path
trusty-snippets-extension-2.0.1.pre.beta spec/models/user_action_observer_spec.rb
trusty-snippets-extension-2.0.0.pre.beta spec/models/user_action_observer_spec.rb
trusty-snippets-extension-1.1.0 spec/models/user_action_observer_spec.rb
trusty-snippets-extension-1.0.2 spec/models/user_action_observer_spec.rb
trusty-snippets-extension-1.0.1 spec/models/user_action_observer_spec.rb
trusty-snippets-extension-1.0.0 spec/models/user_action_observer_spec.rb
radiant-snippets-extension-1.1.3 spec/models/user_action_observer_spec.rb
radiant-snippets-extension-1.1.2 spec/models/user_action_observer_spec.rb
radiant-snippets-extension-1.1.1 spec/models/user_action_observer_spec.rb
radiant-snippets-extension-1.1.0 spec/models/user_action_observer_spec.rb
radiant-snippets-extension-1.1.0.alpha spec/models/user_action_observer_spec.rb
radiant-snippets-extension-1.0.2 spec/models/user_action_observer_spec.rb