enju_message 0.1.14.pre8 → 0.1.14.pre9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/controllers/messages_controller.rb +2 -2
- data/lib/enju_message/version.rb +1 -1
- data/spec/controllers/messages_controller_spec.rb +32 -16
- data/spec/dummy/app/controllers/application_controller.rb +2 -48
- data/spec/dummy/config/application.rb +2 -0
- data/spec/dummy/config/initializers/mime_types.rb +0 -1
- data/spec/dummy/db/test.sqlite3 +0 -0
- data/spec/dummy/solr/data/test/index/_6n.tis +0 -0
- data/spec/dummy/solr/data/test/index/segments.gen +0 -0
- data/spec/dummy/solr/data/test/index/{segments_5t → segments_dd} +0 -0
- metadata +49 -23
- data/spec/dummy/db/production.sqlite3 +0 -0
- data/spec/dummy/solr/data/test/index/_2v.tis +0 -0
- /data/spec/dummy/solr/data/test/index/{_2v.fdt → _6n.fdt} +0 -0
- /data/spec/dummy/solr/data/test/index/{_2v.fdx → _6n.fdx} +0 -0
- /data/spec/dummy/solr/data/test/index/{_2v.fnm → _6n.fnm} +0 -0
- /data/spec/dummy/solr/data/test/index/{_2v.frq → _6n.frq} +0 -0
- /data/spec/dummy/solr/data/test/index/{_2v.nrm → _6n.nrm} +0 -0
- /data/spec/dummy/solr/data/test/index/{_2v.prx → _6n.prx} +0 -0
- /data/spec/dummy/solr/data/test/index/{_2v.tii → _6n.tii} +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 02a1cae4b9213d73460fd217952044bd0927e09b
|
4
|
+
data.tar.gz: 9110f24a1c7d924470b0d85817db0b62e9410130
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 42e043db562178f4282666cecdf736f00dce2ebb6d68e85fb86d6755d9f4ebc1a6ce1ec4a966d9fe13418641fdf39db37aaec3690183545c6ef91169e45e1e84
|
7
|
+
data.tar.gz: eb19ba49de1db2575a5f1677bf3cdfa31bb264b7156190b236943e55d66c650e01a79c90e2096bdd261fd3917c23feacd005c0d5238a13b91abe8edf8b307427
|
@@ -1,6 +1,6 @@
|
|
1
1
|
class MessagesController < ApplicationController
|
2
|
-
load_and_authorize_resource :except => :index
|
3
|
-
authorize_resource :only => :index
|
2
|
+
load_and_authorize_resource :except => [:index, :show]
|
3
|
+
authorize_resource :only => [:index, :show]
|
4
4
|
before_filter :get_user, :only => :index
|
5
5
|
after_filter :solr_commit, :only => [:create, :update, :destroy, :destroy_selected]
|
6
6
|
|
data/lib/enju_message/version.rb
CHANGED
@@ -86,9 +86,11 @@ describe MessagesController do
|
|
86
86
|
|
87
87
|
it "assigns the requested message as @message" do
|
88
88
|
message = messages(:user1_to_user2_1)
|
89
|
-
|
90
|
-
|
91
|
-
|
89
|
+
lambda{
|
90
|
+
get :show, :id => message.id
|
91
|
+
}.should raise_error(ActiveRecord::RecordNotFound)
|
92
|
+
assigns(:message).should be_nil
|
93
|
+
#response.should be_missing
|
92
94
|
end
|
93
95
|
end
|
94
96
|
|
@@ -97,9 +99,11 @@ describe MessagesController do
|
|
97
99
|
|
98
100
|
it "assigns the requested message as @message" do
|
99
101
|
message = messages(:user1_to_user2_1)
|
100
|
-
|
101
|
-
|
102
|
-
|
102
|
+
lambda{
|
103
|
+
get :show, :id => message.id
|
104
|
+
}.should raise_error(ActiveRecord::RecordNotFound)
|
105
|
+
assigns(:message).should be_nil
|
106
|
+
#response.should be_forbidden
|
103
107
|
end
|
104
108
|
end
|
105
109
|
|
@@ -112,8 +116,10 @@ describe MessagesController do
|
|
112
116
|
end
|
113
117
|
|
114
118
|
it "should should not show other user's message" do
|
115
|
-
|
116
|
-
|
119
|
+
lambda{
|
120
|
+
get :show, :id => messages(:user1_to_user2_1).id
|
121
|
+
}.should raise_error(ActiveRecord::RecordNotFound)
|
122
|
+
#response.should be_missing
|
117
123
|
end
|
118
124
|
end
|
119
125
|
|
@@ -185,9 +191,11 @@ describe MessagesController do
|
|
185
191
|
|
186
192
|
it "assigns the requested message as @message" do
|
187
193
|
message = messages(:user1_to_user2_1)
|
188
|
-
|
194
|
+
lambda{
|
195
|
+
get :edit, :id => message.id
|
196
|
+
}.should raise_error(ActiveRecord::RecordNotFound)
|
189
197
|
assigns(:message).should eq(message)
|
190
|
-
response.should be_missing
|
198
|
+
#response.should be_missing
|
191
199
|
end
|
192
200
|
end
|
193
201
|
|
@@ -320,24 +328,32 @@ describe MessagesController do
|
|
320
328
|
|
321
329
|
describe "with valid params" do
|
322
330
|
it "updates the requested message" do
|
323
|
-
|
331
|
+
lambda{
|
332
|
+
put :update, :id => @message.id, :message => @attrs
|
333
|
+
}.should raise_error(ActiveRecord::RecordNotFound)
|
324
334
|
end
|
325
335
|
|
326
336
|
it "assigns the requested message as @message" do
|
327
|
-
|
337
|
+
lambda{
|
338
|
+
put :update, :id => @message.id, :message => @attrs
|
339
|
+
}.should raise_error(ActiveRecord::RecordNotFound)
|
328
340
|
assigns(:message).should eq(@message)
|
329
|
-
response.should be_missing
|
341
|
+
#response.should be_missing
|
330
342
|
end
|
331
343
|
end
|
332
344
|
|
333
345
|
describe "with invalid params" do
|
334
346
|
it "assigns the requested message as @message" do
|
335
|
-
|
347
|
+
lambda{
|
348
|
+
put :update, :id => @message.id, :message => @invalid_attrs
|
349
|
+
}.should raise_error(ActiveRecord::RecordNotFound)
|
336
350
|
end
|
337
351
|
|
338
352
|
it "re-renders the 'edit' template" do
|
339
|
-
|
340
|
-
|
353
|
+
lambda{
|
354
|
+
put :update, :id => @message.id, :message => @invalid_attrs
|
355
|
+
}.should raise_error(ActiveRecord::RecordNotFound)
|
356
|
+
#response.should be_missing
|
341
357
|
end
|
342
358
|
end
|
343
359
|
end
|
@@ -1,52 +1,6 @@
|
|
1
1
|
class ApplicationController < ActionController::Base
|
2
2
|
protect_from_forgery
|
3
3
|
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
private
|
8
|
-
def render_403
|
9
|
-
return if performed?
|
10
|
-
if user_signed_in?
|
11
|
-
respond_to do |format|
|
12
|
-
format.html {render :template => 'page/403', :status => 403}
|
13
|
-
format.mobile {render :template => 'page/403', :status => 403}
|
14
|
-
format.xml {render :template => 'page/403', :status => 403}
|
15
|
-
format.json
|
16
|
-
end
|
17
|
-
else
|
18
|
-
respond_to do |format|
|
19
|
-
format.html {redirect_to new_user_session_url}
|
20
|
-
format.mobile {redirect_to new_user_session_url}
|
21
|
-
format.xml {render :template => 'page/403', :status => 403}
|
22
|
-
format.json
|
23
|
-
end
|
24
|
-
end
|
25
|
-
end
|
26
|
-
|
27
|
-
def render_404
|
28
|
-
return if performed?
|
29
|
-
respond_to do |format|
|
30
|
-
format.html {render :template => 'page/404', :status => 404}
|
31
|
-
format.mobile {render :template => 'page/404', :status => 404}
|
32
|
-
format.xml {render :template => 'page/404', :status => 404}
|
33
|
-
format.json
|
34
|
-
end
|
35
|
-
end
|
36
|
-
|
37
|
-
def get_user
|
38
|
-
@user = User.where(:username => params[:user_id]).first if params[:user_id]
|
39
|
-
end
|
40
|
-
|
41
|
-
def solr_commit
|
42
|
-
Sunspot.commit
|
43
|
-
end
|
44
|
-
|
45
|
-
def move_position(resource, direction)
|
46
|
-
if ['higher', 'lower'].include?(direction)
|
47
|
-
resource.send("move_#{direction}")
|
48
|
-
redirect_to url_for(:controller => resource.class.to_s.pluralize.underscore)
|
49
|
-
return
|
50
|
-
end
|
51
|
-
end
|
4
|
+
enju_leaf
|
5
|
+
enju_library
|
52
6
|
end
|
data/spec/dummy/db/test.sqlite3
CHANGED
Binary file
|
Binary file
|
Binary file
|
Binary file
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: enju_message
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.14.
|
4
|
+
version: 0.1.14.pre9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Kosuke Tanabe
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-
|
11
|
+
date: 2013-06-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: enju_core
|
@@ -122,6 +122,20 @@ dependencies:
|
|
122
122
|
- - '>='
|
123
123
|
- !ruby/object:Gem::Version
|
124
124
|
version: '0'
|
125
|
+
- !ruby/object:Gem::Dependency
|
126
|
+
name: enju_leaf
|
127
|
+
requirement: !ruby/object:Gem::Requirement
|
128
|
+
requirements:
|
129
|
+
- - ~>
|
130
|
+
- !ruby/object:Gem::Version
|
131
|
+
version: 1.1.0.rc2
|
132
|
+
type: :development
|
133
|
+
prerelease: false
|
134
|
+
version_requirements: !ruby/object:Gem::Requirement
|
135
|
+
requirements:
|
136
|
+
- - ~>
|
137
|
+
- !ruby/object:Gem::Version
|
138
|
+
version: 1.1.0.rc2
|
125
139
|
- !ruby/object:Gem::Dependency
|
126
140
|
name: rspec-rails
|
127
141
|
requirement: !ruby/object:Gem::Requirement
|
@@ -164,6 +178,20 @@ dependencies:
|
|
164
178
|
- - ~>
|
165
179
|
- !ruby/object:Gem::Version
|
166
180
|
version: 2.0.0
|
181
|
+
- !ruby/object:Gem::Dependency
|
182
|
+
name: sunspot-rails-tester
|
183
|
+
requirement: !ruby/object:Gem::Requirement
|
184
|
+
requirements:
|
185
|
+
- - '>='
|
186
|
+
- !ruby/object:Gem::Version
|
187
|
+
version: '0'
|
188
|
+
type: :development
|
189
|
+
prerelease: false
|
190
|
+
version_requirements: !ruby/object:Gem::Requirement
|
191
|
+
requirements:
|
192
|
+
- - '>='
|
193
|
+
- !ruby/object:Gem::Version
|
194
|
+
version: '0'
|
167
195
|
description: Message management for Next-L Enju
|
168
196
|
email:
|
169
197
|
- tanabe@mwr.mediacom.keio.ac.jp
|
@@ -278,7 +306,6 @@ files:
|
|
278
306
|
- spec/dummy/db/migrate/20111201163342_create_user_groups.rb
|
279
307
|
- spec/dummy/db/migrate/20111201163718_create_user_has_roles.rb
|
280
308
|
- spec/dummy/db/migrate/20120213092115_add_queue_to_delayed_jobs.rb
|
281
|
-
- spec/dummy/db/production.sqlite3
|
282
309
|
- spec/dummy/db/schema.rb
|
283
310
|
- spec/dummy/db/test.sqlite3
|
284
311
|
- spec/dummy/public/404.html
|
@@ -298,16 +325,16 @@ files:
|
|
298
325
|
- spec/dummy/solr/conf/spellings.txt
|
299
326
|
- spec/dummy/solr/conf/stopwords.txt
|
300
327
|
- spec/dummy/solr/conf/synonyms.txt
|
301
|
-
- spec/dummy/solr/data/test/index/
|
302
|
-
- spec/dummy/solr/data/test/index/
|
303
|
-
- spec/dummy/solr/data/test/index/
|
304
|
-
- spec/dummy/solr/data/test/index/
|
305
|
-
- spec/dummy/solr/data/test/index/
|
306
|
-
- spec/dummy/solr/data/test/index/
|
307
|
-
- spec/dummy/solr/data/test/index/
|
308
|
-
- spec/dummy/solr/data/test/index/
|
328
|
+
- spec/dummy/solr/data/test/index/_6n.fdt
|
329
|
+
- spec/dummy/solr/data/test/index/_6n.fdx
|
330
|
+
- spec/dummy/solr/data/test/index/_6n.fnm
|
331
|
+
- spec/dummy/solr/data/test/index/_6n.frq
|
332
|
+
- spec/dummy/solr/data/test/index/_6n.nrm
|
333
|
+
- spec/dummy/solr/data/test/index/_6n.prx
|
334
|
+
- spec/dummy/solr/data/test/index/_6n.tii
|
335
|
+
- spec/dummy/solr/data/test/index/_6n.tis
|
309
336
|
- spec/dummy/solr/data/test/index/segments.gen
|
310
|
-
- spec/dummy/solr/data/test/index/
|
337
|
+
- spec/dummy/solr/data/test/index/segments_dd
|
311
338
|
- spec/dummy/solr/data/test/spellchecker/segments.gen
|
312
339
|
- spec/dummy/solr/data/test/spellchecker/segments_1
|
313
340
|
- spec/factories/message.rb
|
@@ -348,7 +375,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
348
375
|
version: 1.3.1
|
349
376
|
requirements: []
|
350
377
|
rubyforge_project:
|
351
|
-
rubygems_version: 2.0.
|
378
|
+
rubygems_version: 2.0.2
|
352
379
|
signing_key:
|
353
380
|
specification_version: 4
|
354
381
|
summary: enju_message plugin
|
@@ -413,7 +440,6 @@ test_files:
|
|
413
440
|
- spec/dummy/db/migrate/20111201163342_create_user_groups.rb
|
414
441
|
- spec/dummy/db/migrate/20111201163718_create_user_has_roles.rb
|
415
442
|
- spec/dummy/db/migrate/20120213092115_add_queue_to_delayed_jobs.rb
|
416
|
-
- spec/dummy/db/production.sqlite3
|
417
443
|
- spec/dummy/db/schema.rb
|
418
444
|
- spec/dummy/db/test.sqlite3
|
419
445
|
- spec/dummy/public/404.html
|
@@ -433,16 +459,16 @@ test_files:
|
|
433
459
|
- spec/dummy/solr/conf/spellings.txt
|
434
460
|
- spec/dummy/solr/conf/stopwords.txt
|
435
461
|
- spec/dummy/solr/conf/synonyms.txt
|
436
|
-
- spec/dummy/solr/data/test/index/
|
437
|
-
- spec/dummy/solr/data/test/index/
|
438
|
-
- spec/dummy/solr/data/test/index/
|
439
|
-
- spec/dummy/solr/data/test/index/
|
440
|
-
- spec/dummy/solr/data/test/index/
|
441
|
-
- spec/dummy/solr/data/test/index/
|
442
|
-
- spec/dummy/solr/data/test/index/
|
443
|
-
- spec/dummy/solr/data/test/index/
|
462
|
+
- spec/dummy/solr/data/test/index/_6n.fdt
|
463
|
+
- spec/dummy/solr/data/test/index/_6n.fdx
|
464
|
+
- spec/dummy/solr/data/test/index/_6n.fnm
|
465
|
+
- spec/dummy/solr/data/test/index/_6n.frq
|
466
|
+
- spec/dummy/solr/data/test/index/_6n.nrm
|
467
|
+
- spec/dummy/solr/data/test/index/_6n.prx
|
468
|
+
- spec/dummy/solr/data/test/index/_6n.tii
|
469
|
+
- spec/dummy/solr/data/test/index/_6n.tis
|
444
470
|
- spec/dummy/solr/data/test/index/segments.gen
|
445
|
-
- spec/dummy/solr/data/test/index/
|
471
|
+
- spec/dummy/solr/data/test/index/segments_dd
|
446
472
|
- spec/dummy/solr/data/test/spellchecker/segments.gen
|
447
473
|
- spec/dummy/solr/data/test/spellchecker/segments_1
|
448
474
|
- spec/factories/message.rb
|
Binary file
|
Binary file
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|