pointless_feedback 1.0.1 → 1.0.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -3,8 +3,10 @@ require 'test_helper'
3
3
  module PointlessFeedback
4
4
  class FeedbackMailerTest < ActionMailer::TestCase
5
5
  before do
6
+ PointlessFeedback.to_emails = 'to@example.com'
7
+
6
8
  @message = FactoryGirl.create(:message)
7
- @mail = FeedbackMailer.feedback('to@example.com', @message)
9
+ @mail = FeedbackMailer.feedback(@message)
8
10
  end
9
11
 
10
12
  test "feedback email" do
@@ -51,6 +51,22 @@ module PointlessFeedback
51
51
  end
52
52
  end
53
53
 
54
+ describe "validating against spam" do
55
+ subject { FactoryGirl.build(:message) }
56
+
57
+ it "allows descriptions with no links" do
58
+ subject.description = "I have no links!"
59
+
60
+ assert subject.valid?
61
+ end
62
+
63
+ it "does not allow descriptions with 3 or more links" do
64
+ subject.description = 'CXYz73 <a href="http://kniuzeqqywrg.com/">kniuzeqqywrg</a>, [url=http://kdvfwnevgkcq.com/]kdvfwnevgkcq[/url], [link=http://fibhlwzwvxjr.com/]fibhlwzwvxjr[/link], http://pebecsefhsmz.com/'
65
+
66
+ assert subject.invalid?
67
+ end
68
+ end
69
+
54
70
  describe "export_feedback" do
55
71
  describe "when PointlessFeedback.send_emails is true" do
56
72
  before do
@@ -62,9 +78,7 @@ module PointlessFeedback
62
78
 
63
79
  it "sends mail after create" do
64
80
  mailer = stub(:deliver => true)
65
- ['test1@example.com', 'test2@example.com'].each do |email|
66
- FeedbackMailer.expects(:feedback).with(email, subject).returns(mailer)
67
- end
81
+ FeedbackMailer.expects(:feedback).with(subject).returns(mailer)
68
82
 
69
83
  subject.save
70
84
  end
metadata CHANGED
@@ -1,20 +1,18 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pointless_feedback
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.1
5
- prerelease:
4
+ version: 1.0.2
6
5
  platform: ruby
7
6
  authors:
8
7
  - Zachary Porter
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2013-11-14 00:00:00.000000000 Z
11
+ date: 2014-08-28 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: rails
16
15
  requirement: !ruby/object:Gem::Requirement
17
- none: false
18
16
  requirements:
19
17
  - - ~>
20
18
  - !ruby/object:Gem::Version
@@ -22,7 +20,6 @@ dependencies:
22
20
  type: :runtime
23
21
  prerelease: false
24
22
  version_requirements: !ruby/object:Gem::Requirement
25
- none: false
26
23
  requirements:
27
24
  - - ~>
28
25
  - !ruby/object:Gem::Version
@@ -30,65 +27,57 @@ dependencies:
30
27
  - !ruby/object:Gem::Dependency
31
28
  name: sqlite3
32
29
  requirement: !ruby/object:Gem::Requirement
33
- none: false
34
30
  requirements:
35
- - - ! '>='
31
+ - - '>='
36
32
  - !ruby/object:Gem::Version
37
33
  version: '0'
38
34
  type: :development
39
35
  prerelease: false
40
36
  version_requirements: !ruby/object:Gem::Requirement
41
- none: false
42
37
  requirements:
43
- - - ! '>='
38
+ - - '>='
44
39
  - !ruby/object:Gem::Version
45
40
  version: '0'
46
41
  - !ruby/object:Gem::Dependency
47
42
  name: capybara
48
43
  requirement: !ruby/object:Gem::Requirement
49
- none: false
50
44
  requirements:
51
- - - ! '>='
45
+ - - '>='
52
46
  - !ruby/object:Gem::Version
53
47
  version: '0'
54
48
  type: :development
55
49
  prerelease: false
56
50
  version_requirements: !ruby/object:Gem::Requirement
57
- none: false
58
51
  requirements:
59
- - - ! '>='
52
+ - - '>='
60
53
  - !ruby/object:Gem::Version
61
54
  version: '0'
62
55
  - !ruby/object:Gem::Dependency
63
56
  name: factory_girl_rails
64
57
  requirement: !ruby/object:Gem::Requirement
65
- none: false
66
58
  requirements:
67
- - - ! '>='
59
+ - - '>='
68
60
  - !ruby/object:Gem::Version
69
61
  version: '0'
70
62
  type: :development
71
63
  prerelease: false
72
64
  version_requirements: !ruby/object:Gem::Requirement
73
- none: false
74
65
  requirements:
75
- - - ! '>='
66
+ - - '>='
76
67
  - !ruby/object:Gem::Version
77
68
  version: '0'
78
69
  - !ruby/object:Gem::Dependency
79
70
  name: launchy
80
71
  requirement: !ruby/object:Gem::Requirement
81
- none: false
82
72
  requirements:
83
- - - ! '>='
73
+ - - '>='
84
74
  - !ruby/object:Gem::Version
85
75
  version: '0'
86
76
  type: :development
87
77
  prerelease: false
88
78
  version_requirements: !ruby/object:Gem::Requirement
89
- none: false
90
79
  requirements:
91
- - - ! '>='
80
+ - - '>='
92
81
  - !ruby/object:Gem::Version
93
82
  version: '0'
94
83
  description: Simple Rails Engine to allow users to submit feedback
@@ -98,6 +87,9 @@ executables: []
98
87
  extensions: []
99
88
  extra_rdoc_files: []
100
89
  files:
90
+ - MIT-LICENSE
91
+ - README.md
92
+ - Rakefile
101
93
  - app/assets/javascripts/pointless_feedback/application.js
102
94
  - app/assets/stylesheets/pointless_feedback/application.css
103
95
  - app/controllers/pointless_feedback/messages_controller.rb
@@ -113,14 +105,13 @@ files:
113
105
  - lib/generators/pointless_feedback/install_generator.rb
114
106
  - lib/generators/pointless_feedback/views_generator.rb
115
107
  - lib/generators/templates/pointless_feedback.rb
108
+ - lib/pointless_feedback.rb
116
109
  - lib/pointless_feedback/controllers/helpers.rb
117
110
  - lib/pointless_feedback/engine.rb
118
111
  - lib/pointless_feedback/version.rb
119
- - lib/pointless_feedback.rb
120
112
  - lib/tasks/pointless_feedback_tasks.rake
121
- - MIT-LICENSE
122
- - Rakefile
123
- - README.md
113
+ - test/dummy/README.rdoc
114
+ - test/dummy/Rakefile
124
115
  - test/dummy/app/assets/javascripts/application.js
125
116
  - test/dummy/app/assets/stylesheets/application.css
126
117
  - test/dummy/app/controllers/application_controller.rb
@@ -128,6 +119,7 @@ files:
128
119
  - test/dummy/app/helpers/application_helper.rb
129
120
  - test/dummy/app/views/home/index.html.erb
130
121
  - test/dummy/app/views/layouts/application.html.erb
122
+ - test/dummy/config.ru
131
123
  - test/dummy/config/application.rb
132
124
  - test/dummy/config/boot.rb
133
125
  - test/dummy/config/database.yml
@@ -143,7 +135,6 @@ files:
143
135
  - test/dummy/config/initializers/wrap_parameters.rb
144
136
  - test/dummy/config/locales/en.yml
145
137
  - test/dummy/config/routes.rb
146
- - test/dummy/config.ru
147
138
  - test/dummy/db/development.sqlite3
148
139
  - test/dummy/db/schema.rb
149
140
  - test/dummy/db/test.sqlite3
@@ -153,8 +144,6 @@ files:
153
144
  - test/dummy/public/422.html
154
145
  - test/dummy/public/500.html
155
146
  - test/dummy/public/favicon.ico
156
- - test/dummy/Rakefile
157
- - test/dummy/README.rdoc
158
147
  - test/dummy/script/rails
159
148
  - test/dummy/tmp/cache/assets/CD8/370/sprockets%2F357970feca3ac29060c1e3861e2c0953
160
149
  - test/dummy/tmp/cache/assets/CDA/AF0/sprockets%2F2b009905de1eb97e693a12d62f76c221
@@ -190,27 +179,26 @@ files:
190
179
  homepage: https://github.com/vigetlabs/pointless-feedback
191
180
  licenses:
192
181
  - MIT
182
+ metadata: {}
193
183
  post_install_message:
194
184
  rdoc_options: []
195
185
  require_paths:
196
186
  - lib
197
187
  required_ruby_version: !ruby/object:Gem::Requirement
198
- none: false
199
188
  requirements:
200
- - - ! '>='
189
+ - - '>='
201
190
  - !ruby/object:Gem::Version
202
191
  version: '0'
203
192
  required_rubygems_version: !ruby/object:Gem::Requirement
204
- none: false
205
193
  requirements:
206
- - - ! '>='
194
+ - - '>='
207
195
  - !ruby/object:Gem::Version
208
196
  version: '0'
209
197
  requirements: []
210
198
  rubyforge_project:
211
- rubygems_version: 1.8.25
199
+ rubygems_version: 2.4.1
212
200
  signing_key:
213
- specification_version: 3
201
+ specification_version: 4
214
202
  summary: Simple Rails Engine to allow users to submit feedback
215
203
  test_files:
216
204
  - test/dummy/app/assets/javascripts/application.js