Specify models attributes that must not be mass assignated

This commit is contained in:
Thibault Jouan
2012-01-07 18:26:38 +00:00
parent 5e6781a656
commit 5145717a3c
4 changed files with 5 additions and 0 deletions

View File

@@ -9,6 +9,7 @@ describe User do
it { should validate_presence_of :email }
it { should validate_presence_of :password }
it { should validate_presence_of :password_hash }
it { should_not allow_mass_assignment_of :password_hash }
context 'when a user with the same email address already exists' do
let(:old_user) { Factory.create(:user, :email => 'unique@example.net') }