refinerycms-inquiries 0.9.8.4 → 0.9.8.5
Sign up to get free protection for your applications and to get access to all the features.
- data/features/create_inquiries.feature +38 -0
- data/features/manage_inquiries.feature +57 -0
- data/features/step_definitions/inquiry_steps.rb +25 -0
- data/features/support/paths.rb +26 -0
- data/lib/gemspec.rb +29 -0
- data/refinerycms-inquiries.gemspec +77 -0
- metadata +18 -14
@@ -0,0 +1,38 @@
|
|
1
|
+
@inquiries @inquiries-create
|
2
|
+
Feature: Create Inquiries
|
3
|
+
In order to contact the website owner
|
4
|
+
I want to create an inquiry
|
5
|
+
|
6
|
+
Background:
|
7
|
+
Given A Refinery user exists
|
8
|
+
And I have no inquiries
|
9
|
+
And I have a page titled "Contact Us" with a custom url "/contact"
|
10
|
+
And I have a page titled "Thank You" with a custom url "/contact/thank_you"
|
11
|
+
|
12
|
+
Scenario: Contact page
|
13
|
+
When I go to the contact page
|
14
|
+
Then I should see "Name *"
|
15
|
+
And I should see "Email *"
|
16
|
+
And I should see "Phone"
|
17
|
+
And I should see "Message *"
|
18
|
+
|
19
|
+
Scenario: Create a valid inquiry
|
20
|
+
When I go to the contact page
|
21
|
+
And I fill in "Name *" with "Philip"
|
22
|
+
And I fill in "Email *" with "phil@refinerycms.com"
|
23
|
+
And I fill in "Message *" with "It sure is good to have a functional test coverage."
|
24
|
+
And I press "Send"
|
25
|
+
Then I should be on the contact thank you page
|
26
|
+
And I should see "Thank You"
|
27
|
+
And I should have 1 inquiries
|
28
|
+
|
29
|
+
Scenario: Create an invalid inquiry
|
30
|
+
When I go to the contact page
|
31
|
+
And I press "Send"
|
32
|
+
Then I should be on the contact create page
|
33
|
+
And I should see "Name can't be blank"
|
34
|
+
And I should not see "Email can't be blank"
|
35
|
+
And I should see "Email is invalid"
|
36
|
+
And I should not see "Phone can't be blank"
|
37
|
+
And I should see "Message can't be blank"
|
38
|
+
And I should have 0 inquiries
|
@@ -0,0 +1,57 @@
|
|
1
|
+
@inquiries @inquiries-manage
|
2
|
+
Feature: Manage Inquiries
|
3
|
+
In order to see inquiries left for me on my website
|
4
|
+
As an Administrator
|
5
|
+
I want to manage inquiries
|
6
|
+
|
7
|
+
Background:
|
8
|
+
Given I am a logged in refinery user
|
9
|
+
And I have no inquiries
|
10
|
+
And I have an inquiry from "David Jones" with email "dave@refinerycms.com" and message "Hello, I really like your website. Was it hard to build and maintain or could anyone do it?"
|
11
|
+
|
12
|
+
Scenario: Inquiries List
|
13
|
+
When I go to the list of inquiries
|
14
|
+
Then I should see "David Jones said Hello, I really like your website. Was it hard to build ..."
|
15
|
+
And I should have 1 inquiries
|
16
|
+
And I should not see "Create"
|
17
|
+
|
18
|
+
Scenario: Spam List
|
19
|
+
When I go to the list of inquiries
|
20
|
+
And I follow "Spam"
|
21
|
+
Then I should see "Hooray! You don't have any spam."
|
22
|
+
|
23
|
+
@inquiry-settings
|
24
|
+
Scenario: Updating who gets notified
|
25
|
+
When I go to the list of inquiries
|
26
|
+
And I follow "Update who gets notified"
|
27
|
+
And I fill in "Send notifications to" with "phil@refinerycms.com"
|
28
|
+
And I press "Save"
|
29
|
+
Then I should be redirected back to "the list of inquiries"
|
30
|
+
And I should see "'Notification Recipients' was successfully updated."
|
31
|
+
And I should be on the list of inquiries
|
32
|
+
|
33
|
+
@inquiry-settings
|
34
|
+
Scenario: Updating confirmation email copy
|
35
|
+
When I go to the list of inquiries
|
36
|
+
And I follow "Edit confirmation email"
|
37
|
+
And I fill in "Message" with "Thanks %name%! We'll never get back to you!"
|
38
|
+
And I press "Save"
|
39
|
+
Then I should be redirected back to "the list of inquiries"
|
40
|
+
And I should see "'Confirmation Body' was successfully updated."
|
41
|
+
And I should be on the list of inquiries
|
42
|
+
|
43
|
+
Scenario: Inquiries Show
|
44
|
+
When I go to the list of inquiries
|
45
|
+
And I follow "Read the inquiry"
|
46
|
+
Then I should see "From David Jones [dave@refinerycms.com]"
|
47
|
+
And I should see "Hello, I really like your website. Was it hard to build and maintain or could anyone do it?"
|
48
|
+
And I should see "Age"
|
49
|
+
And I should see "Back to all Inquiries"
|
50
|
+
And I should see "Remove this inquiry forever"
|
51
|
+
|
52
|
+
Scenario: Inquiries Delete
|
53
|
+
When I go to the list of inquiries
|
54
|
+
And I follow "Read the inquiry"
|
55
|
+
And I follow "Remove this inquiry forever"
|
56
|
+
Then I should see "'David Jones' was successfully destroyed."
|
57
|
+
And I should have 0 inquiries
|
@@ -0,0 +1,25 @@
|
|
1
|
+
Given /^I have no inquiries$/ do
|
2
|
+
Inquiry.delete_all
|
3
|
+
end
|
4
|
+
|
5
|
+
Then /^I should have ([0-9]+) inquiries?$/ do |count|
|
6
|
+
Inquiry.count.should == count.to_i
|
7
|
+
end
|
8
|
+
|
9
|
+
Given /^I have an? inquiry from "([^"]*)" with email "([^\"]*)" and message "([^\"]*)"$/ do |name, email, message|
|
10
|
+
Inquiry.create(:name => name,
|
11
|
+
:email => email,
|
12
|
+
:message => message)
|
13
|
+
end
|
14
|
+
|
15
|
+
Given /^I have an? inquiry titled "([^"]*)"$/ do |title|
|
16
|
+
Inquiry.create(:name => title,
|
17
|
+
:email => 'test@cukes.com',
|
18
|
+
:message => 'cuking ...',
|
19
|
+
:spam => false)
|
20
|
+
|
21
|
+
Inquiry.create(:name => title,
|
22
|
+
:email => 'test@cukes.com',
|
23
|
+
:message => 'cuking ...',
|
24
|
+
:spam => true)
|
25
|
+
end
|
@@ -0,0 +1,26 @@
|
|
1
|
+
module NavigationHelpers
|
2
|
+
module Refinery
|
3
|
+
module Inquiries
|
4
|
+
def path_to(page_name)
|
5
|
+
case page_name
|
6
|
+
when /the contact page/
|
7
|
+
new_inquiry_path
|
8
|
+
|
9
|
+
when /the contact thank you page/
|
10
|
+
thank_you_inquiries_path
|
11
|
+
|
12
|
+
when /the contact create page/
|
13
|
+
inquiries_path
|
14
|
+
|
15
|
+
when /the list of inquiries/
|
16
|
+
admin_inquiries_path
|
17
|
+
|
18
|
+
when /the list of spam inquiries/
|
19
|
+
spam_admin_inquiries_path
|
20
|
+
else
|
21
|
+
nil
|
22
|
+
end
|
23
|
+
end
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
data/lib/gemspec.rb
ADDED
@@ -0,0 +1,29 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
version = '0.9.8.5'
|
3
|
+
raise "Could not get version so gemspec can not be built" if version.nil?
|
4
|
+
files = Dir.glob("**/*").flatten.reject do |file|
|
5
|
+
file =~ /\.gem$/
|
6
|
+
end
|
7
|
+
|
8
|
+
gemspec = <<EOF
|
9
|
+
Gem::Specification.new do |s|
|
10
|
+
s.name = %q{refinerycms-inquiries}
|
11
|
+
s.version = %q{#{version}}
|
12
|
+
s.date = %q{#{Time.now.strftime('%Y-%m-%d')}}
|
13
|
+
s.summary = %q{Inquiry handling functionality for the Refinery CMS project.}
|
14
|
+
s.description = %q{Inquiry handling functionality extracted from Refinery CMS to allow you to have a contact form and manage inquiries in the Refinery backend.}
|
15
|
+
s.homepage = %q{http://refinerycms.com}
|
16
|
+
s.email = %q{info@refinerycms.com}
|
17
|
+
s.authors = ["Resolve Digital"]
|
18
|
+
s.require_paths = %w(lib)
|
19
|
+
|
20
|
+
s.files = [
|
21
|
+
'#{files.join("',\n '")}'
|
22
|
+
]
|
23
|
+
s.require_path = 'lib'
|
24
|
+
|
25
|
+
s.add_dependency('filters_spam', '~> 0.2')
|
26
|
+
end
|
27
|
+
EOF
|
28
|
+
|
29
|
+
File.open(File.expand_path("../../refinerycms-inquiries.gemspec", __FILE__), 'w').puts(gemspec)
|
@@ -0,0 +1,77 @@
|
|
1
|
+
Gem::Specification.new do |s|
|
2
|
+
s.name = %q{refinerycms-inquiries}
|
3
|
+
s.version = %q{0.9.8.5}
|
4
|
+
s.date = %q{2010-09-08}
|
5
|
+
s.summary = %q{Inquiry handling functionality for the Refinery CMS project.}
|
6
|
+
s.description = %q{Inquiry handling functionality extracted from Refinery CMS to allow you to have a contact form and manage inquiries in the Refinery backend.}
|
7
|
+
s.homepage = %q{http://refinerycms.com}
|
8
|
+
s.email = %q{info@refinerycms.com}
|
9
|
+
s.authors = ["Resolve Digital"]
|
10
|
+
s.require_paths = %w(lib)
|
11
|
+
|
12
|
+
s.files = [
|
13
|
+
'app',
|
14
|
+
'app/controllers',
|
15
|
+
'app/controllers/admin',
|
16
|
+
'app/controllers/admin/inquiries_controller.rb',
|
17
|
+
'app/controllers/admin/inquiry_settings_controller.rb',
|
18
|
+
'app/controllers/inquiries_controller.rb',
|
19
|
+
'app/helpers',
|
20
|
+
'app/helpers/inquiries_helper.rb',
|
21
|
+
'app/mailers',
|
22
|
+
'app/mailers/inquiry_mailer.rb',
|
23
|
+
'app/models',
|
24
|
+
'app/models/inquiry.rb',
|
25
|
+
'app/models/inquiry_setting.rb',
|
26
|
+
'app/views',
|
27
|
+
'app/views/admin',
|
28
|
+
'app/views/admin/inquiries',
|
29
|
+
'app/views/admin/inquiries/_inquiry.html.erb',
|
30
|
+
'app/views/admin/inquiries/_submenu.html.erb',
|
31
|
+
'app/views/admin/inquiries/index.html.erb',
|
32
|
+
'app/views/admin/inquiries/show.html.erb',
|
33
|
+
'app/views/admin/inquiries/spam.html.erb',
|
34
|
+
'app/views/admin/inquiry_settings',
|
35
|
+
'app/views/admin/inquiry_settings/_confirmation_email_form.html.erb',
|
36
|
+
'app/views/admin/inquiry_settings/_notification_recipients_form.html.erb',
|
37
|
+
'app/views/admin/inquiry_settings/edit.html.erb',
|
38
|
+
'app/views/inquiries',
|
39
|
+
'app/views/inquiries/new.html.erb',
|
40
|
+
'app/views/inquiries/thank_you.html.erb',
|
41
|
+
'app/views/inquiry_mailer',
|
42
|
+
'app/views/inquiry_mailer/confirmation.html.erb',
|
43
|
+
'app/views/inquiry_mailer/notification.html.erb',
|
44
|
+
'config',
|
45
|
+
'config/locales',
|
46
|
+
'config/locales/da.yml',
|
47
|
+
'config/locales/de.yml',
|
48
|
+
'config/locales/en.yml',
|
49
|
+
'config/locales/es.yml',
|
50
|
+
'config/locales/fr.yml',
|
51
|
+
'config/locales/it.yml',
|
52
|
+
'config/locales/lv.yml',
|
53
|
+
'config/locales/nb.yml',
|
54
|
+
'config/locales/nl.yml',
|
55
|
+
'config/locales/pt-BR.yml',
|
56
|
+
'config/locales/ru.yml',
|
57
|
+
'config/locales/sl.yml',
|
58
|
+
'config/locales/zh-CN.yml',
|
59
|
+
'config/routes.rb',
|
60
|
+
'features',
|
61
|
+
'features/create_inquiries.feature',
|
62
|
+
'features/manage_inquiries.feature',
|
63
|
+
'features/step_definitions',
|
64
|
+
'features/step_definitions/inquiry_steps.rb',
|
65
|
+
'features/support',
|
66
|
+
'features/support/paths.rb',
|
67
|
+
'lib',
|
68
|
+
'lib/gemspec.rb',
|
69
|
+
'lib/inquiries.rb',
|
70
|
+
'license.md',
|
71
|
+
'readme.md',
|
72
|
+
'refinerycms-inquiries.gemspec'
|
73
|
+
]
|
74
|
+
s.require_path = 'lib'
|
75
|
+
|
76
|
+
s.add_dependency('filters_spam', '~> 0.2')
|
77
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: refinerycms-inquiries
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 45
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 9
|
9
9
|
- 8
|
10
|
-
-
|
11
|
-
version: 0.9.8.
|
10
|
+
- 5
|
11
|
+
version: 0.9.8.5
|
12
12
|
platform: ruby
|
13
13
|
authors:
|
14
14
|
- Resolve Digital
|
@@ -16,7 +16,7 @@ autorequire:
|
|
16
16
|
bindir: bin
|
17
17
|
cert_chain: []
|
18
18
|
|
19
|
-
date: 2010-08
|
19
|
+
date: 2010-09-08 00:00:00 +12:00
|
20
20
|
default_executable:
|
21
21
|
dependencies:
|
22
22
|
- !ruby/object:Gem::Dependency
|
@@ -27,11 +27,11 @@ dependencies:
|
|
27
27
|
requirements:
|
28
28
|
- - ~>
|
29
29
|
- !ruby/object:Gem::Version
|
30
|
-
hash:
|
30
|
+
hash: 15
|
31
31
|
segments:
|
32
32
|
- 0
|
33
|
-
-
|
34
|
-
version: "0.
|
33
|
+
- 2
|
34
|
+
version: "0.2"
|
35
35
|
type: :runtime
|
36
36
|
version_requirements: *id001
|
37
37
|
description: Inquiry handling functionality extracted from Refinery CMS to allow you to have a contact form and manage inquiries in the Refinery backend.
|
@@ -76,9 +76,15 @@ files:
|
|
76
76
|
- config/locales/sl.yml
|
77
77
|
- config/locales/zh-CN.yml
|
78
78
|
- config/routes.rb
|
79
|
-
-
|
80
|
-
-
|
79
|
+
- features/create_inquiries.feature
|
80
|
+
- features/manage_inquiries.feature
|
81
|
+
- features/step_definitions/inquiry_steps.rb
|
82
|
+
- features/support/paths.rb
|
83
|
+
- lib/gemspec.rb
|
81
84
|
- lib/inquiries.rb
|
85
|
+
- license.md
|
86
|
+
- readme.md
|
87
|
+
- refinerycms-inquiries.gemspec
|
82
88
|
has_rdoc: true
|
83
89
|
homepage: http://refinerycms.com
|
84
90
|
licenses: []
|
@@ -93,12 +99,10 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
93
99
|
requirements:
|
94
100
|
- - ">="
|
95
101
|
- !ruby/object:Gem::Version
|
96
|
-
hash:
|
102
|
+
hash: 3
|
97
103
|
segments:
|
98
|
-
-
|
99
|
-
|
100
|
-
- 7
|
101
|
-
version: 1.8.7
|
104
|
+
- 0
|
105
|
+
version: "0"
|
102
106
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
103
107
|
none: false
|
104
108
|
requirements:
|