Add a couple specs to user_spec

This commit is contained in:
Raphael 2010-11-04 15:23:58 -07:00
parent 229e202a72
commit 7e568db032

View file

@ -190,6 +190,14 @@ describe User do
it "does not save" do
User.build(@invalid_params).save.should be_false
end
it 'does not save a person' do
lambda { User.build(@invalid_params) }.should_not change(Person, :count)
end
it 'does not generate a key' do
pending 'Validate users before generating keys'
User.should_receive(:generate_key).exactly(0).times
User.build(@invalid_params)
end
end
describe "with malicious params" do
let(:person) {Factory.create :person}