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.
Files changed (55) hide show
  1. data/.specification +2 -1
  2. data/Rakefile +19 -24
  3. data/VERSION +1 -1
  4. data/app/controllers/search_keywords_controller.rb +2 -1
  5. data/app/helpers/article_helper.rb +0 -23
  6. data/app/models/article.rb +4 -3
  7. data/app/models/article_status.rb +2 -0
  8. data/app/models/user.rb +3 -3
  9. data/app/models/user_session.rb +1 -1
  10. data/app/views/article/_article.html.haml +17 -0
  11. data/app/views/article/_article_line.html.haml +14 -0
  12. data/app/views/article/_article_list.html.haml +6 -0
  13. data/app/views/article/_result_summary.html.haml +7 -0
  14. data/app/views/article/_search_form.html.haml +3 -0
  15. data/app/views/article/search.html.haml +7 -0
  16. data/app/views/article/show.html.haml +4 -0
  17. data/app/views/article_statuses/index.html.haml +11 -0
  18. data/app/views/infosources/edit.html.haml +19 -0
  19. data/app/views/infosources/index.html.haml +16 -0
  20. data/app/views/infosources/new.html.haml +17 -0
  21. data/app/views/infosources/show.html.haml +22 -0
  22. data/app/views/infosources/tester.html.haml +7 -0
  23. data/app/views/search_keywords/_form.html.haml +4 -0
  24. data/app/views/search_keywords/edit.html.haml +8 -0
  25. data/app/views/search_keywords/index.html.haml +11 -0
  26. data/app/views/search_keywords/new.html.haml +6 -0
  27. data/app/views/search_keywords/newsupdate.html.haml +11 -0
  28. data/app/views/search_keywords/show.html.haml +12 -0
  29. data/app/views/user_mailer/newsupdate.html.haml +22 -0
  30. data/app/views/user_sessions/new.html.haml +28 -0
  31. data/app/views/users/_user.html.haml +28 -0
  32. data/app/views/users/edit.html.haml +2 -0
  33. data/app/views/users/index.html.haml +10 -0
  34. data/app/views/users/new.html.haml +2 -0
  35. data/app/views/users/show.html.haml +18 -0
  36. data/app/views/users/update.html.haml +0 -0
  37. data/config/locales/hu.yml +152 -110
  38. data/config/locales/sk.yml +152 -110
  39. data/lib/solarsearch/compass.rb +5 -0
  40. data/lib/solarsearch/{locales.rb → rails/locales.rb} +0 -1
  41. data/lib/solarsearch/{routing.rb → rails/routing.rb} +0 -0
  42. data/lib/solarsearch/rails.rb +11 -0
  43. data/lib/solarsearch.rb +6 -7
  44. data/rails/init.rb +1 -0
  45. data/solarsearch.gemspec +47 -16
  46. data/stylesheets/solarsearch/ie.sass +15 -0
  47. data/stylesheets/solarsearch/partials/_article.sass +120 -0
  48. data/stylesheets/solarsearch/partials/_base.sass +11 -0
  49. data/stylesheets/solarsearch/print.sass +3 -0
  50. data/stylesheets/solarsearch/screen.sass +286 -0
  51. data/test/unit/article_test.rb +39 -3
  52. data/test/unit/user_test.rb +25 -4
  53. metadata +43 -12
  54. data/Solarsearch.gemspec +0 -176
  55. data/test/unit/helpers/article_helper_test.rb +0 -20
data/solarsearch.gemspec CHANGED
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{solarsearch}
8
- s.version = "0.0.6"
8
+ s.version = "0.0.9"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Gyorgy Frivolt"]
12
- s.date = %q{2010-02-25}
12
+ s.date = %q{2010-02-28}
13
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
14
  s.email = %q{gyorgy.frivolt@gmail.com}
15
15
  s.extra_rdoc_files = [
@@ -22,7 +22,6 @@ Gem::Specification.new do |s|
22
22
  "LICENSE",
23
23
  "README.rdoc",
24
24
  "Rakefile",
25
- "Solarsearch.gemspec",
26
25
  "VERSION",
27
26
  "app/controllers/article_controller.rb",
28
27
  "app/controllers/article_statuses_controller.rb",
@@ -47,15 +46,49 @@ Gem::Specification.new do |s|
47
46
  "app/models/user.rb",
48
47
  "app/models/user_mailer.rb",
49
48
  "app/models/user_session.rb",
49
+ "app/views/article/_article.html.haml",
50
+ "app/views/article/_article_line.html.haml",
51
+ "app/views/article/_article_list.html.haml",
52
+ "app/views/article/_result_summary.html.haml",
53
+ "app/views/article/_search_form.html.haml",
54
+ "app/views/article/search.html.haml",
55
+ "app/views/article/show.html.haml",
56
+ "app/views/article_statuses/index.html.haml",
57
+ "app/views/infosources/edit.html.haml",
58
+ "app/views/infosources/index.html.haml",
59
+ "app/views/infosources/new.html.haml",
60
+ "app/views/infosources/show.html.haml",
61
+ "app/views/infosources/tester.html.haml",
62
+ "app/views/search_keywords/_form.html.haml",
63
+ "app/views/search_keywords/edit.html.haml",
64
+ "app/views/search_keywords/index.html.haml",
65
+ "app/views/search_keywords/new.html.haml",
66
+ "app/views/search_keywords/newsupdate.html.haml",
67
+ "app/views/search_keywords/show.html.haml",
68
+ "app/views/user_mailer/newsupdate.html.haml",
69
+ "app/views/user_sessions/new.html.haml",
70
+ "app/views/users/_user.html.haml",
71
+ "app/views/users/edit.html.haml",
72
+ "app/views/users/index.html.haml",
73
+ "app/views/users/new.html.haml",
74
+ "app/views/users/show.html.haml",
75
+ "app/views/users/update.html.haml",
50
76
  "config/locales/hu.yml",
51
77
  "config/locales/sk.yml",
52
78
  "init.rb",
53
79
  "install.rb",
54
80
  "lib/solarsearch.rb",
55
- "lib/solarsearch/locales.rb",
56
- "lib/solarsearch/routing.rb",
81
+ "lib/solarsearch/compass.rb",
82
+ "lib/solarsearch/rails.rb",
83
+ "lib/solarsearch/rails/locales.rb",
84
+ "lib/solarsearch/rails/routing.rb",
57
85
  "rails/init.rb",
58
86
  "solarsearch.gemspec",
87
+ "stylesheets/solarsearch/ie.sass",
88
+ "stylesheets/solarsearch/partials/_article.sass",
89
+ "stylesheets/solarsearch/partials/_base.sass",
90
+ "stylesheets/solarsearch/print.sass",
91
+ "stylesheets/solarsearch/screen.sass",
59
92
  "tasks/solarsearch_tasks.rake",
60
93
  "test/blueprints.rb",
61
94
  "test/blueprints/articles.rb",
@@ -76,7 +109,6 @@ Gem::Specification.new do |s|
76
109
  "test/schema.rb",
77
110
  "test/test_helper.rb",
78
111
  "test/unit/article_test.rb",
79
- "test/unit/helpers/article_helper_test.rb",
80
112
  "test/unit/helpers/email_helper_test.rb",
81
113
  "test/unit/helpers/user_sessions_helper_test.rb",
82
114
  "test/unit/helpers/users_helper_test.rb",
@@ -112,7 +144,6 @@ Gem::Specification.new do |s|
112
144
  "test/unit/role_test.rb",
113
145
  "test/unit/article_test.rb",
114
146
  "test/unit/user_mailer_test.rb",
115
- "test/unit/helpers/article_helper_test.rb",
116
147
  "test/unit/helpers/email_helper_test.rb",
117
148
  "test/unit/helpers/user_sessions_helper_test.rb",
118
149
  "test/unit/helpers/users_helper_test.rb",
@@ -126,50 +157,50 @@ Gem::Specification.new do |s|
126
157
 
127
158
  if Gem::Version.new(Gem::RubyGemsVersion) >= Gem::Version.new('1.2.0') then
128
159
  s.add_development_dependency(%q<thoughtbot-shoulda>, [">= 0"])
129
- s.add_runtime_dependency(%q<content_scrapper>, [">= 0.0.4"])
160
+ s.add_runtime_dependency(%q<content_scrapper>, [">= 0.0.6"])
130
161
  s.add_runtime_dependency(%q<compass>, [">= 0"])
131
162
  s.add_runtime_dependency(%q<haml>, [">= 0"])
132
163
  s.add_runtime_dependency(%q<authlogic>, [">= 0"])
133
164
  s.add_runtime_dependency(%q<will_paginate>, [">= 0"])
134
165
  s.add_runtime_dependency(%q<whenever>, [">= 0"])
135
166
  s.add_runtime_dependency(%q<acl9>, [">= 0"])
136
- s.add_runtime_dependency(%q<sunspot>, [">= 0"])
137
- s.add_runtime_dependency(%q<sunspot_rails>, [">= 0"])
167
+ s.add_runtime_dependency(%q<sunspot>, [">= 0.10.9"])
138
168
  s.add_runtime_dependency(%q<RedCloth>, [">= 0"])
139
169
  s.add_runtime_dependency(%q<sanitize>, [">= 0"])
170
+ s.add_runtime_dependency(%q<loofah>, [">= 0"])
140
171
  s.add_runtime_dependency(%q<nokogiri>, [">= 0"])
141
172
  s.add_runtime_dependency(%q<feedzirra>, [">= 0"])
142
173
  s.add_runtime_dependency(%q<mysql>, [">= 0"])
143
174
  else
144
175
  s.add_dependency(%q<thoughtbot-shoulda>, [">= 0"])
145
- s.add_dependency(%q<content_scrapper>, [">= 0.0.4"])
176
+ s.add_dependency(%q<content_scrapper>, [">= 0.0.6"])
146
177
  s.add_dependency(%q<compass>, [">= 0"])
147
178
  s.add_dependency(%q<haml>, [">= 0"])
148
179
  s.add_dependency(%q<authlogic>, [">= 0"])
149
180
  s.add_dependency(%q<will_paginate>, [">= 0"])
150
181
  s.add_dependency(%q<whenever>, [">= 0"])
151
182
  s.add_dependency(%q<acl9>, [">= 0"])
152
- s.add_dependency(%q<sunspot>, [">= 0"])
153
- s.add_dependency(%q<sunspot_rails>, [">= 0"])
183
+ s.add_dependency(%q<sunspot>, [">= 0.10.9"])
154
184
  s.add_dependency(%q<RedCloth>, [">= 0"])
155
185
  s.add_dependency(%q<sanitize>, [">= 0"])
186
+ s.add_dependency(%q<loofah>, [">= 0"])
156
187
  s.add_dependency(%q<nokogiri>, [">= 0"])
157
188
  s.add_dependency(%q<feedzirra>, [">= 0"])
158
189
  s.add_dependency(%q<mysql>, [">= 0"])
159
190
  end
160
191
  else
161
192
  s.add_dependency(%q<thoughtbot-shoulda>, [">= 0"])
162
- s.add_dependency(%q<content_scrapper>, [">= 0.0.4"])
193
+ s.add_dependency(%q<content_scrapper>, [">= 0.0.6"])
163
194
  s.add_dependency(%q<compass>, [">= 0"])
164
195
  s.add_dependency(%q<haml>, [">= 0"])
165
196
  s.add_dependency(%q<authlogic>, [">= 0"])
166
197
  s.add_dependency(%q<will_paginate>, [">= 0"])
167
198
  s.add_dependency(%q<whenever>, [">= 0"])
168
199
  s.add_dependency(%q<acl9>, [">= 0"])
169
- s.add_dependency(%q<sunspot>, [">= 0"])
170
- s.add_dependency(%q<sunspot_rails>, [">= 0"])
200
+ s.add_dependency(%q<sunspot>, [">= 0.10.9"])
171
201
  s.add_dependency(%q<RedCloth>, [">= 0"])
172
202
  s.add_dependency(%q<sanitize>, [">= 0"])
203
+ s.add_dependency(%q<loofah>, [">= 0"])
173
204
  s.add_dependency(%q<nokogiri>, [">= 0"])
174
205
  s.add_dependency(%q<feedzirra>, [">= 0"])
175
206
  s.add_dependency(%q<mysql>, [">= 0"])
@@ -0,0 +1,15 @@
1
+ @import blueprint.sass
2
+
3
+ +blueprint-ie
4
+
5
+ // Note :
6
+ //
7
+ // Compass will center text to fix IE6 container centering.
8
+ // This means all your texts will be centered under all version of IE by default.
9
+ // Please don't forget to restore the correct behavior to your main container (but not the body tag!)
10
+ //
11
+ // Example :
12
+ //
13
+ // .container, .footer
14
+ // :text-align left
15
+
@@ -0,0 +1,120 @@
1
+
2
+ .article
3
+ padding-top: 20px
4
+ text-align: left
5
+
6
+ .article_title
7
+ font-weight: bold
8
+ font-size: 13pt
9
+ font-family: arial
10
+ color: #222222
11
+ text-decoration: none
12
+
13
+ a
14
+ font:
15
+ weight: bold
16
+ size: 13pt
17
+ family: arial
18
+ color: #222222
19
+ text-decoration: none
20
+
21
+ &:visited
22
+ color: #444444
23
+ text-decoration: none
24
+
25
+ &:hover
26
+ color: #444444
27
+ text-decoration: underline
28
+
29
+ .article_source
30
+ font-size: 8pt
31
+ font-family: arial
32
+
33
+ a
34
+ font-size: 8pt
35
+ font-family: arial
36
+ color: #222222
37
+ text-decoration: none
38
+
39
+ &:visited
40
+ font-size: 8pt
41
+ font-family: arial
42
+ color: #444444
43
+ text-decoration: none
44
+
45
+ &:hover
46
+ font-size: 8pt
47
+ font-family: arial
48
+ color: #444444
49
+ text-decoration: underline
50
+
51
+ .article_published
52
+ text-decoration: underline
53
+
54
+ .article_summary
55
+ font-style: italic
56
+
57
+ .article_body
58
+ color: #444444
59
+ font-family: arial
60
+ font-size: 11pt
61
+ font-weight: normal
62
+ text-align: justify
63
+
64
+ a
65
+ color: #222222
66
+ font:
67
+ family: arial
68
+ size: 11pt
69
+ style: italic
70
+ text-decoration: none
71
+
72
+ &:visited
73
+ color: #444444
74
+ font:
75
+ family: arial
76
+ size: 11pt
77
+ style: italic
78
+ text-decoration: none
79
+
80
+
81
+ &:hover
82
+ color: #444444
83
+ font:
84
+ family: arial
85
+ size: 11pt
86
+ style: italic
87
+ text-decoration: underline
88
+
89
+ em
90
+ color: #444444
91
+ font:
92
+ family: arial
93
+ size: 11pt
94
+ style: italic
95
+ text-decoration: none
96
+
97
+ strong, b
98
+ color: #111111
99
+ font:
100
+ family: arial
101
+ size: 11pt
102
+ weight: normal
103
+ text-decoration: none
104
+
105
+ u
106
+ color: #444444
107
+ font:
108
+ family: arial
109
+ size: 11pt
110
+ decoration: underline
111
+
112
+ h1
113
+ color: #000000
114
+ font:
115
+ family: arial
116
+ size: 12pt
117
+ weight: normal
118
+ style: none
119
+ text-decoration: none
120
+
@@ -0,0 +1,11 @@
1
+ // Here is where you can define your constants for your application and to configure the blueprint framework.
2
+ // Feel free to delete these if you want keep the defaults:
3
+
4
+ !blueprint_grid_columns = 24
5
+ !blueprint_container_size = 800px
6
+ !blueprint_grid_margin = 10px
7
+
8
+ // Use this to calculate the width based on the total width.
9
+ // Or you can set !blueprint_grid_width to a fixed value and unset !blueprint_container_size -- it will be calculated for you.
10
+ !blueprint_grid_width = (!blueprint_container_size + !blueprint_grid_margin) / !blueprint_grid_columns - !blueprint_grid_margin
11
+
@@ -0,0 +1,3 @@
1
+ @import blueprint.sass
2
+
3
+ +blueprint-print
@@ -0,0 +1,286 @@
1
+ // This import applies a global reset to any page that imports this stylesheet.
2
+ @import blueprint/reset.sass
3
+ // To configure blueprint, edit the partials/base.sass file.
4
+ @import partials/base.sass
5
+ // Import all the default blueprint modules so that we can access their mixins.
6
+ @import blueprint
7
+ // Import the non-default scaffolding module.
8
+ @import blueprint/modules/scaffolding.sass
9
+
10
+ // Georg Frivolt added: imports of application specific partials
11
+ @import partials/article.sass
12
+
13
+ // To generate css equivalent to the blueprint css but with your configuration applied, uncomment:
14
+ // +blueprint
15
+
16
+ //Recommended Blueprint configuration with scoping and semantic layout:
17
+ +blueprint-typography("body.bp")
18
+ +blueprint-scaffolding("body.bp")
19
+ body.bp
20
+ +blueprint-utilities
21
+ +blueprint-debug
22
+ +blueprint-interaction
23
+ // Remove the scaffolding when you're ready to start doing visual design.
24
+ // Or leave it in if you're happy with how blueprint looks out-of-the-box
25
+ form.bp
26
+ +blueprint-form
27
+
28
+ =links
29
+ a
30
+ color: #222222
31
+ text-decoration: none
32
+ &:visited
33
+ color: #444444
34
+ text-decoration: none
35
+ &:hover
36
+ color: #444444
37
+ text-decoration: underline
38
+
39
+ =blindlinks
40
+ a
41
+ color: #222222
42
+ text-decoration: none
43
+ &:visited
44
+ text-decoration: none
45
+ &:hover
46
+ text-decoration: none
47
+
48
+ =contentcontainer
49
+ +container
50
+ +links
51
+ +prepend-top
52
+ +append-bottom(3em)
53
+
54
+ .pagination
55
+ +links
56
+ background: white
57
+ border:
58
+ bottom: 1px solid #E5E5E5
59
+ top: 1px solid #E5E5E5
60
+ text-align: left
61
+
62
+ span
63
+ &.disabled
64
+ color: #aaa
65
+
66
+ &.current
67
+ font-weight: bold
68
+ background: transparent url(apple-circle.gif) no-repeat 50% 50%
69
+
70
+ font:
71
+ weight: normal
72
+ size: 11pt
73
+ family: arial
74
+
75
+ h1
76
+ font:
77
+ weight: bold
78
+ size: 16px
79
+ family: arial
80
+ text-decoration: none
81
+
82
+ ul
83
+ list-style: disc
84
+ margin-left: 0
85
+ padding-left: 16px
86
+
87
+ // Page layout can be done using mixins applied to your semantic classes and IDs:
88
+ body.big-col
89
+ font:
90
+ size: 11pt
91
+ family: arial
92
+ weight: normal
93
+ color: #444444
94
+
95
+ i, em
96
+ color: #444444
97
+ font-style: italic
98
+ text-decoration: none
99
+
100
+ h2, h3
101
+ color: #000000
102
+ font:
103
+ family: arial
104
+ size: 12pt
105
+ weight: normal
106
+ style: none
107
+ text-decoration: none
108
+
109
+ #container
110
+ +container
111
+
112
+ #header
113
+ +column(!blueprint_grid_columns, true)
114
+ +prepend-top
115
+ text-align: center
116
+ text:
117
+ align: center
118
+ decoration: none
119
+ font: normal
120
+ size: 8pt
121
+ family: arial
122
+ color: #444444
123
+
124
+ h1
125
+ +blindlinks
126
+ font:
127
+ family: arial
128
+ size: 48px
129
+ weight: bold
130
+ style: none
131
+ text:
132
+ align: center
133
+ decoration: none
134
+
135
+ #footer
136
+ +column(!blueprint_grid_columns, true)
137
+ +links
138
+ text-align: center
139
+ font:
140
+ weight: normal
141
+ size: 8pt
142
+ family: arial
143
+
144
+ #menu
145
+ +column(!blueprint_grid_columns, true)
146
+ +prepend-top(1em)
147
+ +append-bottom
148
+ +links
149
+ text-align: center
150
+ font:
151
+ weight: normal
152
+ size: 8pt
153
+ family: arial
154
+
155
+ #content
156
+ // Two thirds of the grid columns, rounding up.
157
+ // With 24 cols, this is 16.
158
+ !content_columns = !blueprint_grid_columns
159
+ // true means it's the last column in the row
160
+ +column(!content_columns, true)
161
+ +contentcontainer
162
+ text-align: center
163
+
164
+ #listing
165
+ // Two thirds of the grid columns, rounding up.
166
+ // With 24 cols, this is 16.
167
+ !content_columns = !blueprint_grid_columns
168
+ // true means it's the last column in the row
169
+ +column(!content_columns, true)
170
+ +contentcontainer
171
+ text-align: left
172
+
173
+ #dialog
174
+ // true means it's the last column in the row
175
+ !margin_columns = ceil(!blueprint_grid_columns / 3)
176
+ !content_columns = ceil(!blueprint_grid_columns / 3)
177
+ +column(!content_columns, true)
178
+ +prepend(!margin_columns)
179
+ +append(!margin_columns)
180
+ +contentcontainer
181
+
182
+ text-align: left
183
+
184
+ a.dialog_item_navigation
185
+ font:
186
+ weight: normal
187
+ size: 10px
188
+ family: arial
189
+ color: #222222
190
+ text-decoration: none
191
+
192
+ &:visited.dialog_item_navigation
193
+ color: #4444444
194
+ text-decoration: none
195
+
196
+ &:hover.dialog_item_navigation
197
+ color: #444444
198
+ text-decoration: underline
199
+
200
+ .detailpagenav a
201
+ font:
202
+ weight: normal
203
+ size: 11pt
204
+ family: arial
205
+ color: #222222
206
+ text-decoration: none
207
+
208
+ &:visited
209
+ color: #444444
210
+ text-decoration: none
211
+
212
+ &:hover
213
+ color: #444444
214
+ text-decoration: underline
215
+
216
+ #notice
217
+ position: absolute
218
+ top: 20px
219
+ right: 10px
220
+ max-width: 200px
221
+ border: 1px solid green
222
+ padding: 1em
223
+ margin: 1em
224
+ bottom: 2em
225
+ font: bold smaller sans-serif
226
+
227
+ fieldset.debug_info
228
+ text-align: left
229
+ margin: 1em
230
+ color: black
231
+ background: white
232
+
233
+ .fieldWithErrors label
234
+ background: red
235
+ color: white
236
+
237
+ .searchsummary
238
+ padding:
239
+ top: 20px
240
+ bottom: 20px
241
+ text-align: center
242
+ +links
243
+
244
+ #errorExplanation
245
+ position: absolute
246
+ top: 20px
247
+ left: 10px
248
+ max-width: 200px
249
+ border: 2px solid black
250
+ padding: 7px
251
+ bottom: 12px
252
+ margin-bottom: 20px
253
+
254
+ h2
255
+ text-align: left
256
+ font:
257
+ weight: normal
258
+ size: 14px
259
+ padding: 5px 5px 5px 15px
260
+ margin: -7px
261
+ background-color: black
262
+ color: white
263
+
264
+ p
265
+ color: black
266
+ font:
267
+ size: 14px
268
+ padding: 15px 5px 5px 5px
269
+ margin-bottom: 0
270
+
271
+ ul
272
+ list-style: square
273
+ padding-left: 20px
274
+
275
+ li
276
+ color: black
277
+ font-size: 14px
278
+ padding: 5px 5px 5px 5px
279
+
280
+ #debug
281
+ +links
282
+ margin-top: 1em
283
+ font-size: 8pt
284
+ text-align: center
285
+ background: black
286
+ color: white
@@ -2,7 +2,7 @@ require 'test_helper'
2
2
 
3
3
  class ArticleTest < ActiveSupport::TestCase
4
4
 
5
- context "for sunspot" do
5
+ context "for basic article tests" do
6
6
 
7
7
  should "create valid article" do
8
8
  assert_difference('Article.count') do
@@ -27,10 +27,13 @@ class ArticleTest < ActiveSupport::TestCase
27
27
  article.url = Sham.incorrect_url
28
28
  assert !article.valid?
29
29
  end
30
+ end
31
+
32
+ context "for sunspot" do
33
+ setup { Sunspot.remove_all! }
30
34
 
31
35
  context "on indexing and searching central-european characters" do
32
36
  setup do
33
- Sunspot.remove_all!
34
37
  10.times { Article.make }
35
38
  [:accent_in_title, :accent_in_summary, :accent_in_body].each { |i| Article.make(i) }
36
39
  Sunspot.commit
@@ -46,11 +49,44 @@ class ArticleTest < ActiveSupport::TestCase
46
49
  end
47
50
 
48
51
  context "on indexing characters prohibited in XML documents" do
49
- setup { Sunspot.remove_all! }
50
52
  should "not raise expcetion" do
51
53
  assert_nothing_raised { Article.make(:with_corrupt_xml_chars) }
52
54
  end
53
55
  end
56
+
57
+ context "on article status" do
58
+ setup do
59
+ @user = User.make
60
+ @article = Article.make
61
+ @article.set_user_status(@user, ArticleStatus::STATUS_SENT)
62
+ Sunspot.commit
63
+ end
64
+ should "change the status of the article for the user" do
65
+ assert_equal @user, @article.article_statuses.first.user
66
+ end
67
+ should "not find the article if the status is excluded from the search" do
68
+ query = @article.title
69
+ self_user = @user
70
+ search = Sunspot.search(Article) do
71
+ keywords query
72
+ dynamic :status do
73
+ without Article.give_user_status_symbol(self_user, ArticleStatus::STATUS_SENT), true
74
+ end
75
+ end
76
+ assert_equal 0, search.results.count
77
+ end
78
+ should "find the article if the status is included to the search" do
79
+ query = @article.title
80
+ self_user = @user
81
+ search = Sunspot.search(Article) do
82
+ keywords query
83
+ dynamic :status do
84
+ with Article.give_user_status_symbol(self_user, ArticleStatus::STATUS_SENT), true
85
+ end
86
+ end
87
+ assert_equal 1, search.results.count
88
+ end
89
+ end
54
90
  end
55
91
  end
56
92