mirror of
https://github.com/danbee/danbarberphoto
synced 2025-03-04 08:49:07 +00:00
Fix contact model and spec.
This commit is contained in:
parent
9c1fb4b57c
commit
0f2f58c42d
@ -11,11 +11,10 @@ class Contact
|
|||||||
attributes.each do |key, value|
|
attributes.each do |key, value|
|
||||||
self.send("#{key}=", value)
|
self.send("#{key}=", value)
|
||||||
end
|
end
|
||||||
@attributes = attributes
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def read_attribute_for_validation(key)
|
def read_attribute_for_validation(key)
|
||||||
@attributes[key]
|
self.send(key)
|
||||||
end
|
end
|
||||||
|
|
||||||
def save
|
def save
|
||||||
|
|||||||
@ -6,4 +6,5 @@ describe Contact do
|
|||||||
it { should validate_presence_of(:message) }
|
it { should validate_presence_of(:message) }
|
||||||
|
|
||||||
it { should allow_value("test@test.com").for(:email) }
|
it { should allow_value("test@test.com").for(:email) }
|
||||||
|
it { should_not allow_value("test@test").for(:email) }
|
||||||
end
|
end
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user