Sha256: 166c9ec5b05973b351192bc4f29151374c030906d6398b4b1329e955ec8438ea

Contents?: true

Size: 682 Bytes

Versions: 9

Compression:

Stored size: 682 Bytes

Contents

require 'spec_helper'

describe VestalVersions::Users do
  let(:updated_by){ User.create(:name => 'Steve Jobs') }
  let(:user){ User.create(:name => 'Steve Richert') }

  it 'defaults to nil' do
    user.update_attributes(:first_name => 'Stephen')
    user.versions.last.user.should be_nil
  end

  it 'accepts and returns an ActiveRecord user' do
    user.update_attributes(:first_name => 'Stephen', :updated_by => updated_by)
    user.versions.last.user.should == updated_by
  end

  it 'accepts and returns a string user name' do
    user.update_attributes(:first_name => 'Stephen', :updated_by => updated_by.name)
    user.versions.last.user.should == updated_by.name
  end
end

Version data entries

9 entries across 9 versions & 6 rubygems

Version Path
houston-vestal_versions-2.0.1 spec/vestal_versions/users_spec.rb
houston-vestal_versions-2.0.0 spec/vestal_versions/users_spec.rb
vestal_versions-2.0.0 spec/vestal_versions/users_spec.rb
mil_vestal_versions-1.2.6 spec/vestal_versions/users_spec.rb
geothird_vestal_versions-1.2.5 spec/vestal_versions/users_spec.rb
geothird_vestal_versions-1.2.4 spec/vestal_versions/users_spec.rb
geothird_vestal_versions-1.2.3 spec/vestal_versions/users_spec.rb
set_vestal_versions-1.2.2 spec/vestal_versions/users_spec.rb
razenha-vestal_versions-1.2.2 spec/vestal_versions/users_spec.rb