Sha256: ce6a0472bc80643b732b592eefa2c972cc614e5f53b07cc01188d4310132deca

Contents?: true

Size: 508 Bytes

Versions: 9

Compression:

Stored size: 508 Bytes

Contents

require 'spec_helper'

describe Volt::UserValidatorHelpers do
  context 'with user' do
    before do
      allow(Volt).to receive(:current_user_id) { 294 }
    end

    it 'should assign user_id when owning by a user' do
      todo = TestUserTodo.new
      expect(todo._user_id).to eq(294)
    end

    it 'should not allow the user_id to be changed' do
      todo = TestUserTodo.new
      expect(todo._user_id).to eq(294)

      todo._user_id = 500

      expect(todo._user_id).to eq(294)
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
volt-0.9.4.pre1 spec/models/user_validation_spec.rb
volt-0.9.3 spec/models/user_validation_spec.rb
volt-0.9.3.pre6 spec/models/user_validation_spec.rb
volt-0.9.3.pre5 spec/models/user_validation_spec.rb
volt-0.9.3.pre4 spec/models/user_validation_spec.rb
volt-0.9.3.pre3 spec/models/user_validation_spec.rb
volt-0.9.3.pre2 spec/models/user_validation_spec.rb
volt-0.9.3.pre1 spec/models/user_validation_spec.rb
volt-0.9.2 spec/models/user_validation_spec.rb