solarsearch 0.0.6 → 0.0.9
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/.specification +2 -1
- data/Rakefile +19 -24
- data/VERSION +1 -1
- data/app/controllers/search_keywords_controller.rb +2 -1
- data/app/helpers/article_helper.rb +0 -23
- data/app/models/article.rb +4 -3
- data/app/models/article_status.rb +2 -0
- data/app/models/user.rb +3 -3
- data/app/models/user_session.rb +1 -1
- data/app/views/article/_article.html.haml +17 -0
- data/app/views/article/_article_line.html.haml +14 -0
- data/app/views/article/_article_list.html.haml +6 -0
- data/app/views/article/_result_summary.html.haml +7 -0
- data/app/views/article/_search_form.html.haml +3 -0
- data/app/views/article/search.html.haml +7 -0
- data/app/views/article/show.html.haml +4 -0
- data/app/views/article_statuses/index.html.haml +11 -0
- data/app/views/infosources/edit.html.haml +19 -0
- data/app/views/infosources/index.html.haml +16 -0
- data/app/views/infosources/new.html.haml +17 -0
- data/app/views/infosources/show.html.haml +22 -0
- data/app/views/infosources/tester.html.haml +7 -0
- data/app/views/search_keywords/_form.html.haml +4 -0
- data/app/views/search_keywords/edit.html.haml +8 -0
- data/app/views/search_keywords/index.html.haml +11 -0
- data/app/views/search_keywords/new.html.haml +6 -0
- data/app/views/search_keywords/newsupdate.html.haml +11 -0
- data/app/views/search_keywords/show.html.haml +12 -0
- data/app/views/user_mailer/newsupdate.html.haml +22 -0
- data/app/views/user_sessions/new.html.haml +28 -0
- data/app/views/users/_user.html.haml +28 -0
- data/app/views/users/edit.html.haml +2 -0
- data/app/views/users/index.html.haml +10 -0
- data/app/views/users/new.html.haml +2 -0
- data/app/views/users/show.html.haml +18 -0
- data/app/views/users/update.html.haml +0 -0
- data/config/locales/hu.yml +152 -110
- data/config/locales/sk.yml +152 -110
- data/lib/solarsearch/compass.rb +5 -0
- data/lib/solarsearch/{locales.rb → rails/locales.rb} +0 -1
- data/lib/solarsearch/{routing.rb → rails/routing.rb} +0 -0
- data/lib/solarsearch/rails.rb +11 -0
- data/lib/solarsearch.rb +6 -7
- data/rails/init.rb +1 -0
- data/solarsearch.gemspec +47 -16
- data/stylesheets/solarsearch/ie.sass +15 -0
- data/stylesheets/solarsearch/partials/_article.sass +120 -0
- data/stylesheets/solarsearch/partials/_base.sass +11 -0
- data/stylesheets/solarsearch/print.sass +3 -0
- data/stylesheets/solarsearch/screen.sass +286 -0
- data/test/unit/article_test.rb +39 -3
- data/test/unit/user_test.rb +25 -4
- metadata +43 -12
- data/Solarsearch.gemspec +0 -176
- data/test/unit/helpers/article_helper_test.rb +0 -20
data/test/unit/user_test.rb
CHANGED
@@ -40,7 +40,21 @@ class UserTest < ActiveSupport::TestCase
|
|
40
40
|
:published_at => Time.now)
|
41
41
|
Sunspot.commit
|
42
42
|
end
|
43
|
-
should
|
43
|
+
should "find every article only once" do
|
44
|
+
assert_equal 3, @user.collect_recent_articles.count
|
45
|
+
end
|
46
|
+
context "on email delivery" do
|
47
|
+
setup do
|
48
|
+
ActionMailer::Base.deliveries = []
|
49
|
+
@user.post_recent_news
|
50
|
+
end
|
51
|
+
should "deliver the collected articles" do
|
52
|
+
assert_emails 3
|
53
|
+
end
|
54
|
+
should "not collect any article after the delivery" do
|
55
|
+
assert_equal 0, @user.collect_recent_articles.count
|
56
|
+
end
|
57
|
+
end
|
44
58
|
end
|
45
59
|
|
46
60
|
context "for more results then can be collected for the user once" do
|
@@ -57,7 +71,8 @@ class UserTest < ActiveSupport::TestCase
|
|
57
71
|
@user.recent_articles_for_search_keyword(@search_keyword).count
|
58
72
|
end
|
59
73
|
should "not collect more than allowed number of articles" do
|
60
|
-
assert_equal User::MAX_NUMBER_OF_ARTICLES_PER_NEWSUPDATE,
|
74
|
+
assert_equal User::MAX_NUMBER_OF_ARTICLES_PER_NEWSUPDATE,
|
75
|
+
@user.collect_recent_articles.count
|
61
76
|
end
|
62
77
|
end
|
63
78
|
|
@@ -81,7 +96,7 @@ class UserTest < ActiveSupport::TestCase
|
|
81
96
|
should "sort the collected list of recent articles" do
|
82
97
|
collected_articles = @user.collect_recent_articles
|
83
98
|
(collected_articles.count - 1).times do |item|
|
84
|
-
assert collected_articles[item].published_at > collected_articles[item+1].published_at
|
99
|
+
assert collected_articles[item].published_at > collected_articles[item+1].published_at,
|
85
100
|
'the articles has to be sorted from newer to older'
|
86
101
|
end
|
87
102
|
end
|
@@ -89,8 +104,10 @@ class UserTest < ActiveSupport::TestCase
|
|
89
104
|
|
90
105
|
context "on filtering spams using the article condition block" do
|
91
106
|
setup do
|
107
|
+
ActionMailer::Base.deliveries = []
|
92
108
|
@search_keyword = SearchKeyword.make(:user => @user, :query => 'spam')
|
93
|
-
Article.make(:body => "spam #{'x'*User::MAX_SIZE_OF_A_MAIL_IN_CHARACTERS}",
|
109
|
+
Article.make(:body => "spam #{'x'*User::MAX_SIZE_OF_A_MAIL_IN_CHARACTERS}",
|
110
|
+
:published_at => Time.now)
|
94
111
|
end
|
95
112
|
should "filter the long articles out, we do not want to send spams" do
|
96
113
|
collected_articles = @user.collect_recent_articles do |article|
|
@@ -98,6 +115,10 @@ class UserTest < ActiveSupport::TestCase
|
|
98
115
|
end
|
99
116
|
assert_equal 0, collected_articles.count
|
100
117
|
end
|
118
|
+
should "not deliver spams" do
|
119
|
+
@user.post_recent_news
|
120
|
+
assert_did_not_send_email
|
121
|
+
end
|
101
122
|
end
|
102
123
|
end
|
103
124
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: solarsearch
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Gyorgy Frivolt
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2010-02-
|
12
|
+
date: 2010-02-28 00:00:00 +01:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
@@ -30,7 +30,7 @@ dependencies:
|
|
30
30
|
requirements:
|
31
31
|
- - ">="
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: 0.0.
|
33
|
+
version: 0.0.6
|
34
34
|
version:
|
35
35
|
- !ruby/object:Gem::Dependency
|
36
36
|
name: compass
|
@@ -100,10 +100,10 @@ dependencies:
|
|
100
100
|
requirements:
|
101
101
|
- - ">="
|
102
102
|
- !ruby/object:Gem::Version
|
103
|
-
version:
|
103
|
+
version: 0.10.9
|
104
104
|
version:
|
105
105
|
- !ruby/object:Gem::Dependency
|
106
|
-
name:
|
106
|
+
name: RedCloth
|
107
107
|
type: :runtime
|
108
108
|
version_requirement:
|
109
109
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -113,7 +113,7 @@ dependencies:
|
|
113
113
|
version: "0"
|
114
114
|
version:
|
115
115
|
- !ruby/object:Gem::Dependency
|
116
|
-
name:
|
116
|
+
name: sanitize
|
117
117
|
type: :runtime
|
118
118
|
version_requirement:
|
119
119
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -123,7 +123,7 @@ dependencies:
|
|
123
123
|
version: "0"
|
124
124
|
version:
|
125
125
|
- !ruby/object:Gem::Dependency
|
126
|
-
name:
|
126
|
+
name: loofah
|
127
127
|
type: :runtime
|
128
128
|
version_requirement:
|
129
129
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -177,7 +177,6 @@ files:
|
|
177
177
|
- LICENSE
|
178
178
|
- README.rdoc
|
179
179
|
- Rakefile
|
180
|
-
- Solarsearch.gemspec
|
181
180
|
- VERSION
|
182
181
|
- app/controllers/article_controller.rb
|
183
182
|
- app/controllers/article_statuses_controller.rb
|
@@ -202,15 +201,49 @@ files:
|
|
202
201
|
- app/models/user.rb
|
203
202
|
- app/models/user_mailer.rb
|
204
203
|
- app/models/user_session.rb
|
204
|
+
- app/views/article/_article.html.haml
|
205
|
+
- app/views/article/_article_line.html.haml
|
206
|
+
- app/views/article/_article_list.html.haml
|
207
|
+
- app/views/article/_result_summary.html.haml
|
208
|
+
- app/views/article/_search_form.html.haml
|
209
|
+
- app/views/article/search.html.haml
|
210
|
+
- app/views/article/show.html.haml
|
211
|
+
- app/views/article_statuses/index.html.haml
|
212
|
+
- app/views/infosources/edit.html.haml
|
213
|
+
- app/views/infosources/index.html.haml
|
214
|
+
- app/views/infosources/new.html.haml
|
215
|
+
- app/views/infosources/show.html.haml
|
216
|
+
- app/views/infosources/tester.html.haml
|
217
|
+
- app/views/search_keywords/_form.html.haml
|
218
|
+
- app/views/search_keywords/edit.html.haml
|
219
|
+
- app/views/search_keywords/index.html.haml
|
220
|
+
- app/views/search_keywords/new.html.haml
|
221
|
+
- app/views/search_keywords/newsupdate.html.haml
|
222
|
+
- app/views/search_keywords/show.html.haml
|
223
|
+
- app/views/user_mailer/newsupdate.html.haml
|
224
|
+
- app/views/user_sessions/new.html.haml
|
225
|
+
- app/views/users/_user.html.haml
|
226
|
+
- app/views/users/edit.html.haml
|
227
|
+
- app/views/users/index.html.haml
|
228
|
+
- app/views/users/new.html.haml
|
229
|
+
- app/views/users/show.html.haml
|
230
|
+
- app/views/users/update.html.haml
|
205
231
|
- config/locales/hu.yml
|
206
232
|
- config/locales/sk.yml
|
207
233
|
- init.rb
|
208
234
|
- install.rb
|
209
235
|
- lib/solarsearch.rb
|
210
|
-
- lib/solarsearch/
|
211
|
-
- lib/solarsearch/
|
236
|
+
- lib/solarsearch/compass.rb
|
237
|
+
- lib/solarsearch/rails.rb
|
238
|
+
- lib/solarsearch/rails/locales.rb
|
239
|
+
- lib/solarsearch/rails/routing.rb
|
212
240
|
- rails/init.rb
|
213
241
|
- solarsearch.gemspec
|
242
|
+
- stylesheets/solarsearch/ie.sass
|
243
|
+
- stylesheets/solarsearch/partials/_article.sass
|
244
|
+
- stylesheets/solarsearch/partials/_base.sass
|
245
|
+
- stylesheets/solarsearch/print.sass
|
246
|
+
- stylesheets/solarsearch/screen.sass
|
214
247
|
- tasks/solarsearch_tasks.rake
|
215
248
|
- test/blueprints.rb
|
216
249
|
- test/blueprints/articles.rb
|
@@ -231,7 +264,6 @@ files:
|
|
231
264
|
- test/schema.rb
|
232
265
|
- test/test_helper.rb
|
233
266
|
- test/unit/article_test.rb
|
234
|
-
- test/unit/helpers/article_helper_test.rb
|
235
267
|
- test/unit/helpers/email_helper_test.rb
|
236
268
|
- test/unit/helpers/user_sessions_helper_test.rb
|
237
269
|
- test/unit/helpers/users_helper_test.rb
|
@@ -289,7 +321,6 @@ test_files:
|
|
289
321
|
- test/unit/role_test.rb
|
290
322
|
- test/unit/article_test.rb
|
291
323
|
- test/unit/user_mailer_test.rb
|
292
|
-
- test/unit/helpers/article_helper_test.rb
|
293
324
|
- test/unit/helpers/email_helper_test.rb
|
294
325
|
- test/unit/helpers/user_sessions_helper_test.rb
|
295
326
|
- test/unit/helpers/users_helper_test.rb
|
data/Solarsearch.gemspec
DELETED
@@ -1,176 +0,0 @@
|
|
1
|
-
# Generated by jeweler
|
2
|
-
# DO NOT EDIT THIS FILE DIRECTLY
|
3
|
-
# Instead, edit Jeweler::Tasks in Rakefile, and run the gemspec command
|
4
|
-
# -*- encoding: utf-8 -*-
|
5
|
-
|
6
|
-
Gem::Specification.new do |s|
|
7
|
-
s.name = %q{Solarsearch}
|
8
|
-
s.version = "0.0.1"
|
9
|
-
|
10
|
-
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
|
-
s.authors = ["Gyorgy Frivolt"]
|
12
|
-
s.date = %q{2010-02-12}
|
13
|
-
s.description = %q{Have a search motor built on the top of Solr, a highly customizable, scalable and well performing search engine. You are only few steps away from creating your own search motor.}
|
14
|
-
s.email = %q{gyorgy.frivolt@gmail.com}
|
15
|
-
s.extra_rdoc_files = [
|
16
|
-
"LICENSE",
|
17
|
-
"README.rdoc"
|
18
|
-
]
|
19
|
-
s.files = [
|
20
|
-
".gitignore",
|
21
|
-
"LICENSE",
|
22
|
-
"README.rdoc",
|
23
|
-
"Rakefile",
|
24
|
-
"VERSION",
|
25
|
-
"app/controllers/article_controller.rb",
|
26
|
-
"app/controllers/article_statuses_controller.rb",
|
27
|
-
"app/controllers/infosources_controller.rb",
|
28
|
-
"app/controllers/search_keywords_controller.rb",
|
29
|
-
"app/controllers/user_sessions_controller.rb",
|
30
|
-
"app/controllers/users_controller.rb",
|
31
|
-
"app/helpers/article_helper.rb",
|
32
|
-
"app/helpers/article_statuses_helper.rb",
|
33
|
-
"app/helpers/infosources_helper.rb",
|
34
|
-
"app/helpers/layout_helper.rb",
|
35
|
-
"app/helpers/search_keywords_helper.rb",
|
36
|
-
"app/helpers/site_helper.rb",
|
37
|
-
"app/helpers/user_sessions_helper.rb",
|
38
|
-
"app/helpers/users_helper.rb",
|
39
|
-
"app/models/article.rb",
|
40
|
-
"app/models/article_status.rb",
|
41
|
-
"app/models/infosource.rb",
|
42
|
-
"app/models/role.rb",
|
43
|
-
"app/models/roles_users.rb",
|
44
|
-
"app/models/search_keyword.rb",
|
45
|
-
"app/models/user.rb",
|
46
|
-
"app/models/user_mailer.rb",
|
47
|
-
"app/models/user_session.rb",
|
48
|
-
"config/locales/sk.yml",
|
49
|
-
"init.rb",
|
50
|
-
"install.rb",
|
51
|
-
"lib/solarsearch.rb",
|
52
|
-
"lib/solarsearch/locales.rb",
|
53
|
-
"lib/solarsearch/routing.rb",
|
54
|
-
"rails/init.rb",
|
55
|
-
"solarsearch.gemspec",
|
56
|
-
"tasks/solarsearch_tasks.rake",
|
57
|
-
"test/blueprints.rb",
|
58
|
-
"test/blueprints/articles.rb",
|
59
|
-
"test/blueprints/infosources.rb",
|
60
|
-
"test/blueprints/infosources_files/pretty.html",
|
61
|
-
"test/blueprints/infosources_files/ugly.html",
|
62
|
-
"test/blueprints/search_keywords.rb",
|
63
|
-
"test/blueprints/users.rb",
|
64
|
-
"test/database.yml",
|
65
|
-
"test/functional/article_controller_test.rb",
|
66
|
-
"test/functional/email_controller_test.rb",
|
67
|
-
"test/functional/infosources_controller_test.rb",
|
68
|
-
"test/functional/restricted_logged_exceptions_controller_test.rb",
|
69
|
-
"test/functional/search_keywords_controller_test.rb",
|
70
|
-
"test/functional/user_sessions_controller_test.rb",
|
71
|
-
"test/functional/users_controller_test.rb",
|
72
|
-
"test/schema.rb",
|
73
|
-
"test/solarsearch_test.rb",
|
74
|
-
"test/test_case_additions.rb",
|
75
|
-
"test/test_helper.rb",
|
76
|
-
"test/unit/article_test.rb",
|
77
|
-
"test/unit/helpers/article_helper_test.rb",
|
78
|
-
"test/unit/helpers/email_helper_test.rb",
|
79
|
-
"test/unit/helpers/infosources_helper_test.rb",
|
80
|
-
"test/unit/helpers/user_sessions_helper_test.rb",
|
81
|
-
"test/unit/helpers/users_helper_test.rb",
|
82
|
-
"test/unit/infosource_test.rb",
|
83
|
-
"test/unit/role_test.rb",
|
84
|
-
"test/unit/roles_users_test.rb",
|
85
|
-
"test/unit/user_mailer_test.rb",
|
86
|
-
"test/unit/user_test.rb",
|
87
|
-
"uninstall.rb"
|
88
|
-
]
|
89
|
-
s.homepage = %q{http://github.com/fifigyuri/solarsearch}
|
90
|
-
s.rdoc_options = ["--charset=UTF-8"]
|
91
|
-
s.require_paths = ["lib"]
|
92
|
-
s.rubygems_version = %q{1.3.5}
|
93
|
-
s.summary = %q{Searching made so simple that it is even a fun}
|
94
|
-
s.test_files = [
|
95
|
-
"test/test_case_additions.rb",
|
96
|
-
"test/blueprints/users.rb",
|
97
|
-
"test/blueprints/articles.rb",
|
98
|
-
"test/blueprints/search_keywords.rb",
|
99
|
-
"test/blueprints/infosources.rb",
|
100
|
-
"test/schema.rb",
|
101
|
-
"test/functional/search_keywords_controller_test.rb",
|
102
|
-
"test/functional/users_controller_test.rb",
|
103
|
-
"test/functional/infosources_controller_test.rb",
|
104
|
-
"test/functional/article_controller_test.rb",
|
105
|
-
"test/functional/restricted_logged_exceptions_controller_test.rb",
|
106
|
-
"test/functional/user_sessions_controller_test.rb",
|
107
|
-
"test/functional/email_controller_test.rb",
|
108
|
-
"test/solarsearch_test.rb",
|
109
|
-
"test/test_helper.rb",
|
110
|
-
"test/unit/user_test.rb",
|
111
|
-
"test/unit/roles_users_test.rb",
|
112
|
-
"test/unit/infosource_test.rb",
|
113
|
-
"test/unit/role_test.rb",
|
114
|
-
"test/unit/article_test.rb",
|
115
|
-
"test/unit/user_mailer_test.rb",
|
116
|
-
"test/unit/helpers/infosources_helper_test.rb",
|
117
|
-
"test/unit/helpers/article_helper_test.rb",
|
118
|
-
"test/unit/helpers/email_helper_test.rb",
|
119
|
-
"test/unit/helpers/user_sessions_helper_test.rb",
|
120
|
-
"test/unit/helpers/users_helper_test.rb",
|
121
|
-
"test/blueprints.rb"
|
122
|
-
]
|
123
|
-
|
124
|
-
if s.respond_to? :specification_version then
|
125
|
-
current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
|
126
|
-
s.specification_version = 3
|
127
|
-
|
128
|
-
if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
|
129
|
-
s.add_development_dependency(%q<thoughtbot-shoulda>, [">= 0"])
|
130
|
-
s.add_runtime_dependency(%q<compass>, [">= 0"])
|
131
|
-
s.add_runtime_dependency(%q<haml>, [">= 0"])
|
132
|
-
s.add_runtime_dependency(%q<authlogic>, [">= 0"])
|
133
|
-
s.add_runtime_dependency(%q<will_paginate>, [">= 0"])
|
134
|
-
s.add_runtime_dependency(%q<whenever>, [">= 0"])
|
135
|
-
s.add_runtime_dependency(%q<acl9>, [">= 0"])
|
136
|
-
s.add_runtime_dependency(%q<sunspot>, [">= 0"])
|
137
|
-
s.add_runtime_dependency(%q<sunspot_rails>, [">= 0"])
|
138
|
-
s.add_runtime_dependency(%q<RedCloth>, [">= 0"])
|
139
|
-
s.add_runtime_dependency(%q<sanitize>, [">= 0"])
|
140
|
-
s.add_runtime_dependency(%q<nokogiri>, [">= 0"])
|
141
|
-
s.add_runtime_dependency(%q<feedzirra>, [">= 0"])
|
142
|
-
s.add_runtime_dependency(%q<mysql>, [">= 0"])
|
143
|
-
else
|
144
|
-
s.add_dependency(%q<thoughtbot-shoulda>, [">= 0"])
|
145
|
-
s.add_dependency(%q<compass>, [">= 0"])
|
146
|
-
s.add_dependency(%q<haml>, [">= 0"])
|
147
|
-
s.add_dependency(%q<authlogic>, [">= 0"])
|
148
|
-
s.add_dependency(%q<will_paginate>, [">= 0"])
|
149
|
-
s.add_dependency(%q<whenever>, [">= 0"])
|
150
|
-
s.add_dependency(%q<acl9>, [">= 0"])
|
151
|
-
s.add_dependency(%q<sunspot>, [">= 0"])
|
152
|
-
s.add_dependency(%q<sunspot_rails>, [">= 0"])
|
153
|
-
s.add_dependency(%q<RedCloth>, [">= 0"])
|
154
|
-
s.add_dependency(%q<sanitize>, [">= 0"])
|
155
|
-
s.add_dependency(%q<nokogiri>, [">= 0"])
|
156
|
-
s.add_dependency(%q<feedzirra>, [">= 0"])
|
157
|
-
s.add_dependency(%q<mysql>, [">= 0"])
|
158
|
-
end
|
159
|
-
else
|
160
|
-
s.add_dependency(%q<thoughtbot-shoulda>, [">= 0"])
|
161
|
-
s.add_dependency(%q<compass>, [">= 0"])
|
162
|
-
s.add_dependency(%q<haml>, [">= 0"])
|
163
|
-
s.add_dependency(%q<authlogic>, [">= 0"])
|
164
|
-
s.add_dependency(%q<will_paginate>, [">= 0"])
|
165
|
-
s.add_dependency(%q<whenever>, [">= 0"])
|
166
|
-
s.add_dependency(%q<acl9>, [">= 0"])
|
167
|
-
s.add_dependency(%q<sunspot>, [">= 0"])
|
168
|
-
s.add_dependency(%q<sunspot_rails>, [">= 0"])
|
169
|
-
s.add_dependency(%q<RedCloth>, [">= 0"])
|
170
|
-
s.add_dependency(%q<sanitize>, [">= 0"])
|
171
|
-
s.add_dependency(%q<nokogiri>, [">= 0"])
|
172
|
-
s.add_dependency(%q<feedzirra>, [">= 0"])
|
173
|
-
s.add_dependency(%q<mysql>, [">= 0"])
|
174
|
-
end
|
175
|
-
end
|
176
|
-
|
@@ -1,20 +0,0 @@
|
|
1
|
-
require 'test_helper'
|
2
|
-
|
3
|
-
class ArticleHelperTest < ActionView::TestCase
|
4
|
-
|
5
|
-
test "text shortening" do
|
6
|
-
text = 'This text here should remain. This still has to remain after shortening. But this should not.'
|
7
|
-
|
8
|
-
shortened_text = shorten_text(text, number_of_characters = 70, more_link = '..')
|
9
|
-
assert_equal 'This text here should remain. This still has to remain after shortening...', shortened_text
|
10
|
-
end
|
11
|
-
|
12
|
-
test "text shortening with nill or empty text" do
|
13
|
-
assert_equal '', shorten_text(nil)
|
14
|
-
assert_equal '', shorten_text('')
|
15
|
-
end
|
16
|
-
|
17
|
-
test "test shortener should return the same text if it short" do
|
18
|
-
assert_equal 'this is short', shorten_text('this is short', 20)
|
19
|
-
end
|
20
|
-
end
|