Sha256: d9ab58f28de7f50a2d8ce0d24621cd00f964df6117d6ec90091124040c2a8d0c

Contents?: true

Size: 816 Bytes

Versions: 7

Compression:

Stored size: 816 Bytes

Contents

require 'spec_helper'

describe UsersController, :type => :controller do
  let(:trashable) { Trashable.create!(:name => 'Bob') }

  describe 'create' do
    before { post :create }
    subject { Draftsman::Draft.last }

    it 'records user name via `user_for_draftsman`' do
      expect(subject.whodunnit).to eql 'A User'
    end
  end

  describe 'update' do
    before { put :update, :id => trashable.id }
    subject { return Draftsman::Draft.last }

    it 'records user name via `user_for_draftsman`' do
      expect(subject.whodunnit).to eql 'A User'
    end
  end

  describe 'destroy' do
    before { delete :destroy, :id => trashable.id }
    subject { return Draftsman::Draft.last }

    it 'records user name via `user_for_draftsman`' do
      expect(subject.whodunnit).to eql 'A User'
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
draftsman-0.4.0 spec/controllers/users_controller_spec.rb
draftsman-0.3.7 spec/controllers/users_controller_spec.rb
draftsman-0.3.6 spec/controllers/users_controller_spec.rb
draftsman-0.3.5 spec/controllers/users_controller_spec.rb
draftsman-0.3.4 spec/controllers/users_controller_spec.rb
draftsman-0.3.3 spec/controllers/users_controller_spec.rb
draftsman-0.3.2 spec/controllers/users_controller_spec.rb