noodall-form-builder 0.2.9 → 0.2.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/app/models/noodall/form.rb
CHANGED
@@ -6,7 +6,7 @@ module Noodall
|
|
6
6
|
|
7
7
|
key :title, String, :required => true
|
8
8
|
key :description, String
|
9
|
-
key :email, String, :format =>
|
9
|
+
key :email, String, :format => /^[-a-z0-9_+\.]+\@([-a-z0-9]+\.)+[a-z0-9]{2,4}$/i
|
10
10
|
key :thank_you_message, :default => 'Thank you for getting in contact.'
|
11
11
|
key :thank_you_email, :default => 'Thank you for getting in contact.'
|
12
12
|
|
@@ -3,7 +3,7 @@ module Noodall
|
|
3
3
|
include MongoMapper::Document
|
4
4
|
|
5
5
|
key :name, String
|
6
|
-
key :email, String, :format =>
|
6
|
+
key :email, String, :format => /^[-a-z0-9_+\.]+\@([-a-z0-9]+\.)+[a-z0-9]{2,4}$/i
|
7
7
|
key :ip, String, :required => true
|
8
8
|
key :referrer, String, :required => true
|
9
9
|
key :created_at, Time, :required => true
|
@@ -33,7 +33,7 @@ module Noodall
|
|
33
33
|
self.save!
|
34
34
|
self.class.defensio.put_document(defensio_signature, { :allow => false })
|
35
35
|
end
|
36
|
-
|
36
|
+
|
37
37
|
def is_spam?
|
38
38
|
self.approved == false
|
39
39
|
end
|
@@ -30,15 +30,15 @@ Feature: Form Module
|
|
30
30
|
When a form response is deemed to be spam
|
31
31
|
Then it should marked as spam
|
32
32
|
And they should receive no emails
|
33
|
-
|
33
|
+
|
34
34
|
Given I am viewing the form's responses
|
35
35
|
And I mark the response as not spam
|
36
|
-
|
36
|
+
|
37
37
|
Then the email address of the form should receive an email detailing the information submitted
|
38
38
|
And they should receive an email confirming the request has been sent
|
39
|
-
|
40
|
-
|
41
|
-
|
39
|
+
|
40
|
+
|
41
|
+
|
42
42
|
Scenario: Validation
|
43
43
|
Given content exists with a form added via the contact module
|
44
44
|
When a website visitor visits the content
|
@@ -47,6 +47,20 @@ Feature: Form Module
|
|
47
47
|
And it should be rejected if the the response does not meet the validation
|
48
48
|
And the website visitor should see an error message
|
49
49
|
|
50
|
+
Scenario Outline: Validate Email Address
|
51
|
+
Given content exists with a form added via the contact module
|
52
|
+
When a website visitor visits the content
|
53
|
+
And fill in "Email" with "<invalid email>"
|
54
|
+
And they submit the form
|
55
|
+
Then I should see "Email is invalid"
|
56
|
+
|
57
|
+
Examples:
|
58
|
+
| invalid email |
|
59
|
+
| steve@moon |
|
60
|
+
| spoon@buttonmooon.com dave@test.com |
|
61
|
+
| spoon@buttonmooon.com; dave@test.com |
|
62
|
+
|
63
|
+
|
50
64
|
Scenario: Custom Thank You Messages
|
51
65
|
Given a form exists with the following:
|
52
66
|
| thank_you_message | Thanks for that |
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: noodall-form-builder
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 3
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 2
|
9
|
-
-
|
10
|
-
version: 0.2.
|
9
|
+
- 10
|
10
|
+
version: 0.2.10
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Steve England
|
@@ -17,13 +17,12 @@ autorequire:
|
|
17
17
|
bindir: bin
|
18
18
|
cert_chain: []
|
19
19
|
|
20
|
-
date: 2011-06-
|
20
|
+
date: 2011-06-27 00:00:00 +01:00
|
21
21
|
default_executable:
|
22
22
|
dependencies:
|
23
23
|
- !ruby/object:Gem::Dependency
|
24
|
-
|
25
|
-
|
26
|
-
requirement: &id001 !ruby/object:Gem::Requirement
|
24
|
+
name: bundler
|
25
|
+
version_requirements: &id001 !ruby/object:Gem::Requirement
|
27
26
|
none: false
|
28
27
|
requirements:
|
29
28
|
- - ">="
|
@@ -34,12 +33,12 @@ dependencies:
|
|
34
33
|
- 0
|
35
34
|
- 0
|
36
35
|
version: 1.0.0
|
37
|
-
|
38
|
-
name: bundler
|
39
|
-
- !ruby/object:Gem::Dependency
|
36
|
+
type: :development
|
40
37
|
prerelease: false
|
41
|
-
|
42
|
-
|
38
|
+
requirement: *id001
|
39
|
+
- !ruby/object:Gem::Dependency
|
40
|
+
name: fastercsv
|
41
|
+
version_requirements: &id002 !ruby/object:Gem::Requirement
|
43
42
|
none: false
|
44
43
|
requirements:
|
45
44
|
- - ">="
|
@@ -48,8 +47,9 @@ dependencies:
|
|
48
47
|
segments:
|
49
48
|
- 0
|
50
49
|
version: "0"
|
51
|
-
|
52
|
-
|
50
|
+
type: :runtime
|
51
|
+
prerelease: false
|
52
|
+
requirement: *id002
|
53
53
|
description: Functionality for building custom forms
|
54
54
|
email: []
|
55
55
|
|
@@ -205,7 +205,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
205
205
|
requirements: []
|
206
206
|
|
207
207
|
rubyforge_project:
|
208
|
-
rubygems_version: 1.
|
208
|
+
rubygems_version: 1.4.1
|
209
209
|
signing_key:
|
210
210
|
specification_version: 3
|
211
211
|
summary: Noodall Form Builder
|