mirror of
https://github.com/internetee/registry.git
synced 2025-07-03 01:33:36 +02:00
Basic contact model validations
This commit is contained in:
parent
1e2dad06f9
commit
3caac94bfb
3 changed files with 31 additions and 0 deletions
|
@ -15,6 +15,19 @@ describe Contact do
|
|||
@contact.ident = "123abc"
|
||||
expect(@contact.valid?).to be false
|
||||
end
|
||||
|
||||
it 'should return missing parameter error messages' do
|
||||
@contact = Contact.new
|
||||
expect(@contact.valid?).to eq false
|
||||
|
||||
expect(@contact.errors.messages).to match_array({
|
||||
:code=>["Required parameter missing - code"],
|
||||
:name=>["Required parameter missing - name"],
|
||||
:phone=>["Required parameter missing - phone", "bad format"],
|
||||
:email=>["Required parameter missing - email"],
|
||||
:ident=>["Required parameter missing - ident"]
|
||||
})
|
||||
end
|
||||
end
|
||||
|
||||
context 'with valid attributes' do
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue