Using shoulda gem you be able to validate fields one by one
describe Contact do
it { should validate_presence_of :Name }
it { should validate_presence_of :Email }
it { should validate_presence_of :Phone }
end
https://github.com/thoughtbot/shoulda-matchers#validate_presence_of
You also be able to check whole object validation by:
it { expect(FactoryGirl.build(:contact)).to be_valid }
I suppose you're using factory_girl to build your test data
Update: Suppose you have a valid factory. Then you be able to test without shoulda gem
it { expect(FactoryGirl.build(:contract, :Name => '')).to be_invalid }
it { expect(FactoryGirl.build(:contract, :Email => '')).to be_invalid }
it { expect(FactoryGirl.build(:contract, :Phone => '')).to be_invalid }
Update 2: Without factory_girl
it { expect(Contact.new(:Name => 'Bruce', :Email => 'email@example.com', :Phone => '+123123')).to be_valid }
it { expect(Contact.new(:Email => 'email@example.com', :Phone => '+123123')).to be_invalid }
it { expect(Contact.new(:Name => 'Bruce', :Phone => '+123123')).to be_invalid }
it { expect(Contact.new(:Name => 'Bruce', :Email => 'email@example.com')).to be_invalid }