noodall-form-builder 0.2.2 → 0.2.3
Sign up to get free protection for your applications and to get access to all the features.
@@ -66,6 +66,10 @@ module Noodall
|
|
66
66
|
def mark_as_not_spam
|
67
67
|
@response = @form.responses.find(params[:id])
|
68
68
|
@response.approve!
|
69
|
+
|
70
|
+
FormMailer.form_response(@form, @response).deliver unless @form.email.blank?
|
71
|
+
FormMailer.form_response_thankyou(@form, @response).deliver
|
72
|
+
|
69
73
|
redirect_to(noodall_admin_form_form_responses_url(@form))
|
70
74
|
end
|
71
75
|
|
@@ -30,7 +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
|
+
Given I am viewing the form's responses
|
35
|
+
And I mark the response as not spam
|
36
|
+
|
37
|
+
Then the email address of the form should receive an email detailing the information submitted
|
38
|
+
And they should receive an email confirming the request has been sent
|
39
|
+
|
40
|
+
|
41
|
+
|
34
42
|
Scenario: Validation
|
35
43
|
Given content exists with a form added via the contact module
|
36
44
|
When a website visitor visits the content
|
@@ -9,9 +9,9 @@ Then /^I should see a form with at least the following fields:$/ do |table|
|
|
9
9
|
end
|
10
10
|
|
11
11
|
When /^I fill the following fields:$/ do |table|
|
12
|
-
table.
|
13
|
-
@new_form_name = row[
|
14
|
-
fill_in row[
|
12
|
+
table.hashes.each do |row|
|
13
|
+
@new_form_name = row["Value"] if @new_form_name.nil?
|
14
|
+
fill_in row["Field"], :with => row["Value"]
|
15
15
|
end
|
16
16
|
end
|
17
17
|
|
@@ -189,6 +189,7 @@ When /^a form response is deemed to be spam$/ do
|
|
189
189
|
When %{a website visitor visits the content}
|
190
190
|
defensio_dummy = double("defensio dummy")
|
191
191
|
defensio_dummy.stub(:post_document){ [200, {'spaminess' => 1, "allow" => false}] }
|
192
|
+
defensio_dummy.stub(:put_document){ [200, {"allow" => false}] }
|
192
193
|
|
193
194
|
Noodall::FormResponse.stub(:defensio).and_return(defensio_dummy)
|
194
195
|
When %{they fill in and submit the form}
|
@@ -260,3 +261,12 @@ Given /^a form exists with the following:$/ do |fields|
|
|
260
261
|
@_form = Factory(:form, fields.rows_hash)
|
261
262
|
end
|
262
263
|
|
264
|
+
Given /^I am viewing the form's responses$/ do
|
265
|
+
visit noodall_admin_form_form_responses_path(@_form)
|
266
|
+
end
|
267
|
+
|
268
|
+
Given /^I mark the response as not spam$/ do
|
269
|
+
When %{I follow "Not Spam?"} # This is tied to the current page, could be abstracted a little more
|
270
|
+
end
|
271
|
+
|
272
|
+
|
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: 17
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 2
|
9
|
-
-
|
10
|
-
version: 0.2.
|
9
|
+
- 3
|
10
|
+
version: 0.2.3
|
11
11
|
platform: ruby
|
12
12
|
authors: []
|
13
13
|
|