refinerycms-inquiries 2.1.0 → 3.0.0
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.
- checksums.yaml +4 -4
- data/.travis.yml +5 -6
- data/Gemfile +14 -18
- data/Rakefile +0 -1
- data/app/assets/stylesheets/refinery/inquiries/inquiries.css.scss +3 -0
- data/app/controllers/refinery/inquiries/admin/inquiries_controller.rb +9 -3
- data/app/controllers/refinery/inquiries/admin/settings_controller.rb +34 -16
- data/app/controllers/refinery/inquiries/inquiries_controller.rb +29 -13
- data/app/mailers/refinery/inquiries/inquiry_mailer.rb +20 -10
- data/app/models/refinery/inquiries/inquiry.rb +13 -11
- data/app/models/refinery/inquiries/setting.rb +33 -31
- data/app/views/refinery/inquiries/admin/inquiries/_submenu.html.erb +7 -7
- data/app/views/refinery/inquiries/admin/settings/_confirmation_email_form.html.erb +2 -2
- data/app/views/refinery/inquiries/inquiries/_form.html.erb +35 -0
- data/app/views/refinery/inquiries/inquiries/new.html.erb +4 -38
- data/bin/rails +5 -0
- data/bin/rake +21 -0
- data/bin/rspec +22 -0
- data/bin/spring +18 -0
- data/config/locales/bg.yml +2 -2
- data/config/locales/cs.yml +2 -2
- data/config/locales/da.yml +2 -2
- data/config/locales/de.yml +2 -2
- data/config/locales/en-GB.yml +2 -2
- data/config/locales/en.yml +2 -2
- data/config/locales/es.yml +2 -2
- data/config/locales/fr.yml +2 -2
- data/config/locales/it.yml +1 -1
- data/config/locales/lt.yml +2 -2
- data/config/locales/lv.yml +2 -2
- data/config/locales/nb.yml +2 -2
- data/config/locales/nl.yml +2 -2
- data/config/locales/pl.yml +2 -2
- data/config/locales/pt-BR.yml +2 -2
- data/config/locales/ru.yml +2 -2
- data/config/locales/sk.yml +2 -2
- data/config/locales/sl.yml +2 -2
- data/config/locales/sv.yml +2 -2
- data/config/locales/zh-CN.yml +2 -2
- data/config/locales/zh-TW.yml +79 -0
- data/config/routes.rb +11 -7
- data/db/migrate/20101208082840_create_inquiries.rb +4 -3
- data/db/seeds.rb +9 -11
- data/lib/generators/refinery/inquiries/templates/config/initializers/refinery/inquiries.rb.erb +8 -0
- data/lib/refinery/inquiries/configuration.rb +6 -0
- data/lib/refinery/inquiries/engine.rb +3 -7
- data/readme.md +23 -10
- data/refinerycms-inquiries.gemspec +4 -3
- data/spec/factories/inquiry.rb +4 -2
- data/spec/features/refinery/inquiries/admin/inquiries_spec.rb +32 -43
- data/spec/features/refinery/inquiries/inquiries_spec.rb +37 -32
- data/spec/features/refinery/inquiries/mailer_spec.rb +15 -14
- data/spec/models/refinery/inquiries/inquiry_spec.rb +62 -20
- data/spec/models/refinery/inquiries/setting_spec.rb +19 -0
- data/spec/spec_helper.rb +3 -3
- metadata +39 -18
data/config/locales/zh-CN.yml
CHANGED
@@ -0,0 +1,79 @@
|
|
1
|
+
zh-TW:
|
2
|
+
refinery:
|
3
|
+
plugins:
|
4
|
+
refinerycms_inquiries:
|
5
|
+
title: 咨詢
|
6
|
+
description: 提供一個連絡表格及咨詢記錄
|
7
|
+
inquiries:
|
8
|
+
config:
|
9
|
+
from_name: "%{name} - %{site_name}"
|
10
|
+
inquiries:
|
11
|
+
form:
|
12
|
+
send: 發送消息
|
13
|
+
privacy_policy: 我们珍惜您的私隐
|
14
|
+
admin:
|
15
|
+
inquiries:
|
16
|
+
delete: 永久删除此咨詢
|
17
|
+
inquiry:
|
18
|
+
read_inquiry: 閱讀此咨詢
|
19
|
+
said: 說
|
20
|
+
mark_as_spam: 標記為垃圾郵件
|
21
|
+
mark_as_ham: 移到收件箱
|
22
|
+
submenu:
|
23
|
+
inbox: 收件箱
|
24
|
+
spam: 垃圾郵件
|
25
|
+
update_notified: 更新通知名單
|
26
|
+
edit_confirmation_email: 編輯確認電郵
|
27
|
+
index:
|
28
|
+
no_inquiries: 你還没有收到任何的咨詢。
|
29
|
+
no_spam: 沒有垃圾郵件。
|
30
|
+
show:
|
31
|
+
details: 詳細
|
32
|
+
age: 時間
|
33
|
+
actions: 操作
|
34
|
+
back_to_all_inquiries: 返回所有的咨詢
|
35
|
+
spam: 垃圾郵件
|
36
|
+
spam_yes: '是'
|
37
|
+
inquiry: 咨詢
|
38
|
+
to: 收件人
|
39
|
+
from: 發件人
|
40
|
+
click_to_email: 點擊發送到這個地址
|
41
|
+
phone: 電話
|
42
|
+
date: 日期
|
43
|
+
message: 信息
|
44
|
+
settings:
|
45
|
+
notification_recipients_form:
|
46
|
+
inquiry_settings_value_name: 發送通知到
|
47
|
+
hint: 當收到新的咨詢時,系統將會發一封電郵通知你。
|
48
|
+
example: "輸入你的電郵地址如: jack@work.com, jill@office.com"
|
49
|
+
confirmation_email_form:
|
50
|
+
to: 到
|
51
|
+
from: 從
|
52
|
+
subject: 標題
|
53
|
+
click_to_edit_subject: 點擊這裡編輯標題
|
54
|
+
explanation: 每當有人在網站聯系你,系統發送出一封電郵去確認發送者的身份.
|
55
|
+
below_edit_email_sent: 你可以在下面编輯你要發送去的電郵。
|
56
|
+
the_customer_making_inquiry: 客户正在寫咨詢
|
57
|
+
message: 信息
|
58
|
+
note: "注意: 把你的客户名字在電郵出現的位置以文字 %name% 做替換"
|
59
|
+
inquiry_mailer:
|
60
|
+
notification:
|
61
|
+
greeting: 您好
|
62
|
+
you_recieved_new_inquiry: 你剛從你的網站收到一條新的咨詢.
|
63
|
+
inquiry_starts: --- 咨詢開始處 ---
|
64
|
+
inquiry_ends: --- 咨詢結束處 ---
|
65
|
+
from: 表單
|
66
|
+
email: 電郵
|
67
|
+
phone: 電話
|
68
|
+
message: 信息
|
69
|
+
closing_line: 謹致問候
|
70
|
+
ps: 附言 您所有的咨詢被保存在“咨詢”區域以便你在日後查看。
|
71
|
+
activerecord:
|
72
|
+
models:
|
73
|
+
refinery/inquiries/inquiry: inquiry
|
74
|
+
attributes:
|
75
|
+
refinery/inquiries/inquiry:
|
76
|
+
name: 姓名
|
77
|
+
email: 電郵
|
78
|
+
phone: 連絡電話
|
79
|
+
message: 留言信息
|
data/config/routes.rb
CHANGED
@@ -1,14 +1,18 @@
|
|
1
1
|
Refinery::Core::Engine.routes.draw do
|
2
|
+
# Frontend routes
|
2
3
|
namespace :inquiries, :path => '' do
|
3
|
-
get
|
4
|
+
get Refinery::Inquiries.page_path_new, :to => 'inquiries#new', :as => 'new_inquiry'
|
4
5
|
|
5
|
-
resources :contact,
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
get :thank_you, :on => :collection
|
6
|
+
resources :contact, :path => Refinery::Inquiries.post_path, :only => [:create],
|
7
|
+
:as => :inquiries, :controller => 'inquiries'
|
8
|
+
|
9
|
+
resources :contact, :path => '', :only => [], :as => :inquiries, :controller => 'inquiries' do
|
10
|
+
get :thank_you, :path => Refinery::Inquiries.page_path_thank_you, :on => :collection
|
10
11
|
end
|
12
|
+
end
|
11
13
|
|
14
|
+
# Admin routes
|
15
|
+
namespace :inquiries, :path => '' do
|
12
16
|
namespace :admin, :path => Refinery::Core.backend_route do
|
13
17
|
resources :inquiries, :only => [:index, :show, :destroy] do
|
14
18
|
get :spam, :on => :collection
|
@@ -20,4 +24,4 @@ Refinery::Core::Engine.routes.draw do
|
|
20
24
|
end
|
21
25
|
end
|
22
26
|
end
|
23
|
-
end
|
27
|
+
end
|
@@ -17,8 +17,9 @@ class CreateInquiries < ActiveRecord::Migration
|
|
17
17
|
def down
|
18
18
|
drop_table ::Refinery::Inquiries::Inquiry.table_name
|
19
19
|
|
20
|
-
::Refinery::Page
|
21
|
-
:link_url =>
|
22
|
-
|
20
|
+
if defined?(::Refinery::Page)
|
21
|
+
::Refinery::Page.delete_all(:link_url => Refinery::Inquiries.page_path_new)
|
22
|
+
::Refinery::Page.delete_all(:link_url => Refinery::Inquiries.page_path_thank_you)
|
23
|
+
end
|
23
24
|
end
|
24
25
|
end
|
data/db/seeds.rb
CHANGED
@@ -1,17 +1,15 @@
|
|
1
1
|
::Refinery::User.all.each do |user|
|
2
|
-
|
3
|
-
user.plugins.create(:name => "refinery_inquiries")
|
4
|
-
end
|
2
|
+
user.plugins.where(:name => 'refinery_inquiries').first_or_create!
|
5
3
|
end if defined?(::Refinery::User)
|
6
4
|
|
7
5
|
if defined?(::Refinery::Page)
|
8
|
-
contact_us_page = Refinery::Page.
|
6
|
+
contact_us_page = Refinery::Page.find_by(:link_url => Refinery::Inquiries.page_path_new)
|
9
7
|
|
10
8
|
unless contact_us_page
|
11
9
|
contact_us_page = ::Refinery::Page.create({
|
12
10
|
:title => "Contact",
|
13
|
-
:link_url =>
|
14
|
-
:menu_match => "
|
11
|
+
:link_url => Refinery::Inquiries.page_path_new,
|
12
|
+
:menu_match => "^(/inquiries.*)|#{Refinery::Inquiries.page_path_new}$",
|
15
13
|
:deletable => false
|
16
14
|
})
|
17
15
|
contact_us_page.parts.create({
|
@@ -26,11 +24,11 @@ if defined?(::Refinery::Page)
|
|
26
24
|
})
|
27
25
|
end
|
28
26
|
|
29
|
-
unless Refinery::Page.where(:link_url =>
|
27
|
+
unless Refinery::Page.where(:link_url => Refinery::Inquiries.page_path_thank_you).any?
|
30
28
|
thank_you_page = contact_us_page.children.create({
|
31
29
|
:title => "Thank You",
|
32
|
-
:link_url =>
|
33
|
-
:menu_match => "
|
30
|
+
:link_url => Refinery::Inquiries.page_path_thank_you,
|
31
|
+
:menu_match => "^(/inquiries/thank_you)|#{Refinery::Inquiries.page_path_thank_you}$",
|
34
32
|
:show_in_menu => false,
|
35
33
|
:deletable => false
|
36
34
|
})
|
@@ -55,6 +53,6 @@ if defined?(::Refinery::Page)
|
|
55
53
|
end
|
56
54
|
end
|
57
55
|
|
58
|
-
(Refinery::Inquiries::Setting.methods.sort -
|
59
|
-
Refinery::Inquiries::Setting.send(setting)
|
56
|
+
(Refinery::Inquiries::Setting.methods.sort - Refinery::Setting.methods).each do |setting|
|
57
|
+
Refinery::Inquiries::Setting.send(setting) if setting.to_s !~ /=\z/
|
60
58
|
end
|
data/lib/generators/refinery/inquiries/templates/config/initializers/refinery/inquiries.rb.erb
CHANGED
@@ -13,4 +13,12 @@ Refinery::Inquiries.configure do |config|
|
|
13
13
|
|
14
14
|
# Configure name in 'from' email address
|
15
15
|
# config.from_name = <%= Refinery::Inquiries.from_name.inspect %>
|
16
|
+
|
17
|
+
# Configure the URLs to use for the inquiry functionality.
|
18
|
+
# config.post_path = <%= Refinery::Inquiries.post_path.inspect %>
|
19
|
+
# config.page_path_new = <%= Refinery::Inquiries.page_path_new.inspect %>
|
20
|
+
# config.page_path_thank_you = <%= Refinery::Inquiries.page_path_thank_you.inspect %>
|
21
|
+
|
22
|
+
# Toggle the spam filter
|
23
|
+
# config.filter_spam = <%= Refinery::Inquiries.filter_spam.inspect %>
|
16
24
|
end
|
@@ -7,11 +7,17 @@ module Refinery
|
|
7
7
|
config_accessor :show_placeholders
|
8
8
|
config_accessor :send_notifications_for_inquiries_marked_as_spam
|
9
9
|
config_accessor :from_name
|
10
|
+
config_accessor :post_path, :page_path_new, :page_path_thank_you
|
11
|
+
config_accessor :filter_spam
|
10
12
|
|
11
13
|
self.show_contact_privacy_link = true
|
12
14
|
self.show_phone_number_field = true
|
13
15
|
self.show_placeholders = true
|
14
16
|
self.send_notifications_for_inquiries_marked_as_spam = false
|
15
17
|
self.from_name = "no-reply"
|
18
|
+
self.post_path = "/contact"
|
19
|
+
self.page_path_new = "/contact"
|
20
|
+
self.page_path_thank_you = "/contact/thank_you"
|
21
|
+
self.filter_spam = true
|
16
22
|
end
|
17
23
|
end
|
@@ -5,19 +5,15 @@ module Refinery
|
|
5
5
|
|
6
6
|
isolate_namespace Refinery::Inquiries
|
7
7
|
|
8
|
-
|
8
|
+
before_inclusion do
|
9
9
|
Refinery::Plugin.register do |plugin|
|
10
10
|
plugin.pathname = root
|
11
11
|
plugin.name = "refinerycms_inquiries"
|
12
12
|
plugin.url = proc { Refinery::Core::Engine.routes.url_helpers.inquiries_admin_inquiries_path }
|
13
13
|
plugin.menu_match = %r{refinery/inquiries(/.+?)?$}
|
14
|
-
plugin.activity = {
|
15
|
-
:class_name => :'refinery/inquiries/inquiry',
|
16
|
-
:title => 'name',
|
17
|
-
:url_prefix => nil,
|
18
|
-
:url => 'refinery.inquiries_admin_inquiries_path'
|
19
|
-
}
|
20
14
|
end
|
15
|
+
|
16
|
+
Rails.application.config.assets.precompile += %w(refinery/inquiries/*)
|
21
17
|
end
|
22
18
|
|
23
19
|
config.after_initialize do
|
data/readme.md
CHANGED
@@ -2,11 +2,25 @@
|
|
2
2
|
|
3
3
|

|
4
4
|
|
5
|
+
## About
|
6
|
+
|
7
|
+
__Add a simple contact form to Refinery that notifies you and the customer when an inquiry is made.__
|
8
|
+
|
9
|
+
In summary you can:
|
10
|
+
|
11
|
+
* Collect and manage inquiries
|
12
|
+
* Specify who is notified when a new inquiry comes in
|
13
|
+
* Customise an auto responder email that is sent to the person making the inquiry
|
14
|
+
|
15
|
+
When inquiries come in, you and the customer are generally notified. As we implemented spam filtering through the [filters_spam plugin](https://github.com/resolve/filters_spam#readme) you will not get notified if an inquiry is marked as 'spam'. This feature is optional, and can be disabled in `config/initializers/refinery/inquiries.rb` by setting `config.filter_spam = false`.
|
16
|
+
|
5
17
|
### Gem Installation using Bundler (The very best way)
|
6
18
|
|
7
19
|
Include the latest [gem](http://rubygems.org/gems/refinerycms-inquiries) into your Refinery CMS application's Gemfile:
|
8
20
|
|
9
|
-
|
21
|
+
```ruby
|
22
|
+
gem 'refinerycms-inquiries', '~> 3.0.0'
|
23
|
+
```
|
10
24
|
|
11
25
|
Then type the following at command line inside your Refinery CMS application's root directory:
|
12
26
|
|
@@ -23,19 +37,18 @@ Add pages to the database and you're done:
|
|
23
37
|
|
24
38
|
rake db:seed
|
25
39
|
|
26
|
-
|
27
|
-
|
28
|
-
__Add a simple contact form to Refinery that notifies you and the customer when an inquiry is made.__
|
40
|
+
#### Optionally include the stylesheet.
|
29
41
|
|
30
|
-
|
42
|
+
Next, you can include the stylesheet that improves the form's display a bit,
|
43
|
+
and also adds an asterisk to each `required` label: `Name *` instead of `Name`.
|
31
44
|
|
32
|
-
|
33
|
-
* Specify who is notified when a new inquiry comes in
|
34
|
-
* Customise an auto responder email that is sent to the person making the inquiry
|
45
|
+
To do this, include it in your `application.css` manifest file and insert:
|
35
46
|
|
36
|
-
|
47
|
+
```css
|
48
|
+
//= require refinery/inquiries/inquiries
|
49
|
+
```
|
37
50
|
|
38
|
-
## How do I
|
51
|
+
## How do I set up email to be sent from GMail, SendGrid or other service?
|
39
52
|
|
40
53
|
Inquiries uses `actionmailer` under the hood so you can refer to [Rails Action Mailer guide](http://guides.rubyonrails.org/action_mailer_basics.html). For example to use GMail see [Action Mailer Configuration for GMail](http://guides.rubyonrails.org/action_mailer_basics.html#action-mailer-configuration-for-gmail) guide.
|
41
54
|
|
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |s|
|
4
4
|
s.name = %q{refinerycms-inquiries}
|
5
|
-
s.version = %q{
|
5
|
+
s.version = %q{3.0.0}
|
6
6
|
s.summary = %q{Inquiry handling functionality for the Refinery CMS project.}
|
7
7
|
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.}
|
8
8
|
s.homepage = %q{http://refinerycms.com}
|
@@ -14,7 +14,8 @@ Gem::Specification.new do |s|
|
|
14
14
|
s.files = `git ls-files`.split("\n")
|
15
15
|
s.test_files = `git ls-files -- spec/*`.split("\n")
|
16
16
|
|
17
|
-
s.add_dependency 'refinerycms-core', '~>
|
18
|
-
s.add_dependency 'refinerycms-settings', '~>
|
17
|
+
s.add_dependency 'refinerycms-core', '~> 3.0.0'
|
18
|
+
s.add_dependency 'refinerycms-settings', '~> 3.0.0'
|
19
19
|
s.add_dependency 'filters_spam', '~> 0.2'
|
20
|
+
s.add_dependency 'actionmailer', '~> 4.2.4'
|
20
21
|
end
|
data/spec/factories/inquiry.rb
CHANGED
@@ -1,7 +1,9 @@
|
|
1
|
+
require "factory_girl"
|
2
|
+
|
1
3
|
FactoryGirl.define do
|
2
|
-
factory :inquiry, :
|
4
|
+
factory :inquiry, class: "Refinery::Inquiries::Inquiry" do
|
3
5
|
name "Refinery"
|
4
|
-
email "refinery@
|
6
|
+
email "refinery@example.com"
|
5
7
|
message "Hello..."
|
6
8
|
end
|
7
9
|
end
|
@@ -3,8 +3,8 @@ require "spec_helper"
|
|
3
3
|
module Refinery
|
4
4
|
module Inquiries
|
5
5
|
module Admin
|
6
|
-
describe Inquiry do
|
7
|
-
|
6
|
+
describe Inquiry, :type => :feature do
|
7
|
+
refinery_login
|
8
8
|
|
9
9
|
let!(:inquiry) do
|
10
10
|
FactoryGirl.create(:inquiry,
|
@@ -14,13 +14,13 @@ module Refinery
|
|
14
14
|
end
|
15
15
|
|
16
16
|
context "when no" do
|
17
|
-
before
|
17
|
+
before { Refinery::Inquiries::Inquiry.destroy_all }
|
18
18
|
|
19
19
|
context "inquiries" do
|
20
20
|
it "shows message" do
|
21
21
|
visit refinery.inquiries_admin_inquiries_path
|
22
22
|
|
23
|
-
page.
|
23
|
+
expect(page).to have_content("You have not received any inquiries yet.")
|
24
24
|
end
|
25
25
|
end
|
26
26
|
|
@@ -28,24 +28,24 @@ module Refinery
|
|
28
28
|
it "shows message" do
|
29
29
|
visit refinery.spam_inquiries_admin_inquiries_path
|
30
30
|
|
31
|
-
page.
|
31
|
+
expect(page).to have_content("Hooray! You don't have any spam.")
|
32
32
|
end
|
33
33
|
end
|
34
34
|
end
|
35
35
|
|
36
36
|
describe "action links" do
|
37
|
-
before
|
37
|
+
before { visit refinery.inquiries_admin_inquiries_path }
|
38
38
|
|
39
39
|
specify "in the side pane" do
|
40
40
|
within "#actions" do
|
41
|
-
page.
|
42
|
-
page.
|
43
|
-
page.
|
44
|
-
page.
|
45
|
-
page.
|
46
|
-
page.
|
47
|
-
page.
|
48
|
-
page.
|
41
|
+
expect(page).to have_content("Inbox")
|
42
|
+
expect(page).to have_selector("a[href='/#{Refinery::Core.backend_route}/inquiries']")
|
43
|
+
expect(page).to have_content("Spam")
|
44
|
+
expect(page).to have_selector("a[href='/#{Refinery::Core.backend_route}/inquiries/spam']")
|
45
|
+
expect(page).to have_content("Update who gets notified")
|
46
|
+
expect(page).to have_selector("a[href*='/#{Refinery::Core.backend_route}/inquiries/settings/inquiry_notification_recipients/edit']")
|
47
|
+
expect(page).to have_content("Edit confirmation email")
|
48
|
+
expect(page).to have_selector("a[href*='/#{Refinery::Core.backend_route}/inquiries/settings/inquiry_confirmation_body/edit']")
|
49
49
|
end
|
50
50
|
end
|
51
51
|
end
|
@@ -54,7 +54,7 @@ module Refinery
|
|
54
54
|
it "shows inquiry list" do
|
55
55
|
visit refinery.inquiries_admin_inquiries_path
|
56
56
|
|
57
|
-
page.
|
57
|
+
expect(page).to have_content("David Jones said Hello, I really like your website. Was it hard to build a...")
|
58
58
|
end
|
59
59
|
end
|
60
60
|
|
@@ -64,14 +64,14 @@ module Refinery
|
|
64
64
|
|
65
65
|
click_link "Read the inquiry"
|
66
66
|
|
67
|
-
page.
|
68
|
-
page.
|
67
|
+
expect(page).to have_content("From David Jones [dave@refinerycms.com]")
|
68
|
+
expect(page).to have_content("Hello, I really like your website. Was it hard to build and maintain or could anyone do it?")
|
69
69
|
within "#actions" do
|
70
|
-
page.
|
71
|
-
page.
|
72
|
-
page.
|
73
|
-
page.
|
74
|
-
page.
|
70
|
+
expect(page).to have_content("Age")
|
71
|
+
expect(page).to have_content("Back to all Inquiries")
|
72
|
+
expect(page).to have_selector("a[href='/#{Refinery::Core.backend_route}/inquiries']")
|
73
|
+
expect(page).to have_content("Remove this inquiry forever")
|
74
|
+
expect(page).to have_selector("a[href='/#{Refinery::Core.backend_route}/inquiries/#{inquiry.id}']")
|
75
75
|
end
|
76
76
|
end
|
77
77
|
end
|
@@ -82,8 +82,8 @@ module Refinery
|
|
82
82
|
|
83
83
|
click_link "Remove this inquiry forever"
|
84
84
|
|
85
|
-
page.
|
86
|
-
Refinery::Inquiries::Inquiry.count.
|
85
|
+
expect(page).to have_content("'#{inquiry.name}' was successfully removed.")
|
86
|
+
expect(Refinery::Inquiries::Inquiry.count).to eq(0)
|
87
87
|
end
|
88
88
|
end
|
89
89
|
|
@@ -94,52 +94,41 @@ module Refinery
|
|
94
94
|
click_link "Mark as spam"
|
95
95
|
|
96
96
|
within "#actions" do
|
97
|
-
page.
|
97
|
+
expect(page).to have_content("Spam (1)")
|
98
98
|
click_link "Spam (1)"
|
99
99
|
end
|
100
100
|
|
101
|
-
page.
|
101
|
+
expect(page).to have_content("David Jones said Hello, I really like your website. Was it hard to build a...")
|
102
102
|
end
|
103
103
|
end
|
104
104
|
|
105
105
|
describe "update who gets notified" do
|
106
|
-
before do
|
107
|
-
Rails.cache.clear
|
108
|
-
Refinery::Inquiries::Setting.notification_recipients
|
109
|
-
end
|
110
|
-
|
111
106
|
it "sets receiver", :js => true do
|
112
107
|
visit refinery.inquiries_admin_inquiries_path
|
113
|
-
|
114
|
-
click_link "Update who gets notified"
|
108
|
+
find("#update_notified").trigger('click')
|
115
109
|
|
116
110
|
within_frame "dialog_iframe" do
|
117
111
|
fill_in "setting_value", :with => "phil@refinerycms.com"
|
118
112
|
click_button "submit_button"
|
119
113
|
end
|
120
114
|
|
121
|
-
page.
|
115
|
+
expect(page).to have_content("Notification Recipients was successfully updated.")
|
122
116
|
end
|
123
117
|
end
|
124
118
|
|
125
119
|
describe "updating confirmation email copy" do
|
126
|
-
before do
|
127
|
-
Rails.cache.clear
|
128
|
-
Refinery::Inquiries::Setting.confirmation_body
|
129
|
-
end
|
130
|
-
|
131
120
|
it "sets message", :js => true do
|
132
121
|
visit refinery.inquiries_admin_inquiries_path
|
133
122
|
|
134
|
-
|
123
|
+
find("#edit_confirmation_email").trigger('click')
|
135
124
|
|
136
125
|
within_frame "dialog_iframe" do
|
137
|
-
fill_in "
|
138
|
-
fill_in "
|
126
|
+
fill_in "setting[subject[en]]", :with => "subject"
|
127
|
+
fill_in "setting[message[en]]", :with => "message"
|
139
128
|
click_button "Save"
|
140
129
|
end
|
141
130
|
|
142
|
-
page.
|
131
|
+
expect(page).to have_content("Confirmation Body was successfully updated.")
|
143
132
|
end
|
144
133
|
end
|
145
134
|
|