modulate 0.0.12 → 0.0.13
Sign up to get free protection for your applications and to get access to all the features.
- data/app/controllers/modulate/documents_controller.rb +2 -2
- data/lib/modulate/version.rb +1 -1
- data/spec/dummy/log/development.log +1 -0
- data/spec/dummy/log/test.log +3341 -0
- data/spec/dummy/public/uploads/tmp/20130530-1328-18378-5665/test.txt +1 -0
- data/spec/dummy/public/uploads/tmp/20130530-1328-18378-7053/test.txt +1 -0
- data/spec/dummy/public/uploads/tmp/20130530-1328-18378-7409/test.txt +1 -0
- data/spec/dummy/tmp/capybara/capybara-201305301250104386415623.html +45 -0
- data/spec/dummy/tmp/capybara/capybara-201305301250471031790437.html +53 -0
- data/spec/dummy/tmp/capybara/capybara-201305301251356698936017.html +53 -0
- data/spec/dummy/tmp/capybara/capybara-201305301254318405365845.html +53 -0
- data/spec/dummy/tmp/capybara/capybara-201305301334158549042667.html +1 -0
- data/spec/dummy/tmp/capybara/capybara-201305301336008526948343.html +1 -0
- data/spec/dummy/tmp/capybara/capybara-201305301336478327145176.html +1 -0
- data/spec/dummy/tmp/capybara/capybara-20130530133716805682676.html +1 -0
- data/spec/dummy/tmp/capybara/capybara-201305301408065641681440.html +1 -0
- data/spec/features/modulate_spec.rb +37 -11
- data/spec/modulate_spec.rb +2 -2
- metadata +28 -4
@@ -0,0 +1 @@
|
|
1
|
+
This is a test document.
|
@@ -0,0 +1 @@
|
|
1
|
+
This is a test document.
|
@@ -0,0 +1 @@
|
|
1
|
+
This is a test document.
|
@@ -0,0 +1,45 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<title>Dummy</title>
|
5
|
+
<link href="/assets/application.css" media="all" rel="stylesheet" type="text/css" />
|
6
|
+
<script src="/assets/application.js" type="text/javascript"></script>
|
7
|
+
|
8
|
+
</head>
|
9
|
+
<body>
|
10
|
+
|
11
|
+
|
12
|
+
|
13
|
+
<form accept-charset="UTF-8" action="/accounts/109" class="formtastic account" enctype="multipart/form-data" id="edit_account_109" method="post" novalidate="novalidate"><div style="margin:0;padding:0;display:inline"><input name="utf8" type="hidden" value="✓" /><input name="_method" type="hidden" value="put" /></div><table class='table table-bordered table-compressed'>
|
14
|
+
<thead>
|
15
|
+
<tr>
|
16
|
+
<th>Label</th>
|
17
|
+
<th>File Name</th>
|
18
|
+
<th>Content Type</th>
|
19
|
+
<th>Uploaded At</th>
|
20
|
+
<th>Public</th>
|
21
|
+
<th></th>
|
22
|
+
<th></th>
|
23
|
+
</tr>
|
24
|
+
</thead>
|
25
|
+
<tbody>
|
26
|
+
<tr>
|
27
|
+
<td colspan='7'>
|
28
|
+
<div class='no-results'>There are no documents.</div>
|
29
|
+
</td>
|
30
|
+
</tr>
|
31
|
+
</tbody>
|
32
|
+
</table>
|
33
|
+
|
34
|
+
<fieldset class="inputs"><ol><li class="file input required" id="account_modulate_uploads_attributes_0_attachment_input"><label class=" label" for="account_modulate_uploads_attributes_0_attachment">Choose document to attach<abbr title="required">*</abbr></label><input id="account_modulate_uploads_attributes_0_attachment" multiple="multiple" name="account[modulate_uploads_attributes][][attachment]" type="file" />
|
35
|
+
|
36
|
+
</li>
|
37
|
+
</ol></fieldset><fieldset class="actions"><ol><li class="action button_action " id="account_submit_action"><button class="btn btn-primary" name="button" type="submit">Update Account</button></li>
|
38
|
+
<li class="action link_action " id="account_cancel_action"><a href="javascript:history.back()">Cancel</a></li>
|
39
|
+
</ol></fieldset></form>
|
40
|
+
|
41
|
+
|
42
|
+
|
43
|
+
|
44
|
+
</body>
|
45
|
+
</html>
|
@@ -0,0 +1,53 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<title>Dummy</title>
|
5
|
+
<link href="/assets/application.css" media="all" rel="stylesheet" type="text/css" />
|
6
|
+
<script src="/assets/application.js" type="text/javascript"></script>
|
7
|
+
|
8
|
+
</head>
|
9
|
+
<body>
|
10
|
+
|
11
|
+
|
12
|
+
|
13
|
+
<form accept-charset="UTF-8" action="/accounts/112" class="formtastic account" enctype="multipart/form-data" id="edit_account_112" method="post" novalidate="novalidate"><div style="margin:0;padding:0;display:inline"><input name="utf8" type="hidden" value="✓" /><input name="_method" type="hidden" value="put" /></div><table class='table table-bordered table-compressed'>
|
14
|
+
<thead>
|
15
|
+
<tr>
|
16
|
+
<th>Label</th>
|
17
|
+
<th>File Name</th>
|
18
|
+
<th>Content Type</th>
|
19
|
+
<th>Uploaded At</th>
|
20
|
+
<th>Public</th>
|
21
|
+
<th></th>
|
22
|
+
<th></th>
|
23
|
+
</tr>
|
24
|
+
</thead>
|
25
|
+
<tbody>
|
26
|
+
<tr>
|
27
|
+
<td><input id="account_modulate_documents_attributes_0_label" name="account[modulate_documents_attributes][0][label]" size="30" type="text" value="Test" /></td>
|
28
|
+
<td>test.txt</td>
|
29
|
+
<td>text/plain</td>
|
30
|
+
<td>Thu, 30 May 2013 16:50:47 +0000</td>
|
31
|
+
<td><input name="account[modulate_documents_attributes][0][public]" type="hidden" value="0" /><input id="account_modulate_documents_attributes_0_public" name="account[modulate_documents_attributes][0][public]" type="checkbox" value="1" /></td>
|
32
|
+
<td>
|
33
|
+
<a href="/modulate/documents/84" rel="tooltip" title="Download"><i class='icon-download'></i>
|
34
|
+
</a></td>
|
35
|
+
<td>
|
36
|
+
<a href="/modulate/documents/84" data-confirm="Are you sure?" data-method="delete" rel="tooltip" title="Delete"><i class='icon-remove-circle'></i>
|
37
|
+
</a></td>
|
38
|
+
</tr>
|
39
|
+
<input id="account_modulate_documents_attributes_0_id" name="account[modulate_documents_attributes][0][id]" type="hidden" value="84" /></tbody>
|
40
|
+
</table>
|
41
|
+
|
42
|
+
<fieldset class="inputs"><ol><li class="file input required" id="account_modulate_uploads_attributes_0_attachment_input"><label class=" label" for="account_modulate_uploads_attributes_0_attachment">Choose document to attach<abbr title="required">*</abbr></label><input id="account_modulate_uploads_attributes_0_attachment" multiple="multiple" name="account[modulate_uploads_attributes][][attachment]" type="file" />
|
43
|
+
|
44
|
+
</li>
|
45
|
+
</ol></fieldset><fieldset class="actions"><ol><li class="action button_action " id="account_submit_action"><button class="btn btn-primary" name="button" type="submit">Update Account</button></li>
|
46
|
+
<li class="action link_action " id="account_cancel_action"><a href="javascript:history.back()">Cancel</a></li>
|
47
|
+
</ol></fieldset></form>
|
48
|
+
|
49
|
+
|
50
|
+
|
51
|
+
|
52
|
+
</body>
|
53
|
+
</html>
|
@@ -0,0 +1,53 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<title>Dummy</title>
|
5
|
+
<link href="/assets/application.css" media="all" rel="stylesheet" type="text/css" />
|
6
|
+
<script src="/assets/application.js" type="text/javascript"></script>
|
7
|
+
|
8
|
+
</head>
|
9
|
+
<body>
|
10
|
+
|
11
|
+
|
12
|
+
|
13
|
+
<form accept-charset="UTF-8" action="/accounts/115" class="formtastic account" enctype="multipart/form-data" id="edit_account_115" method="post" novalidate="novalidate"><div style="margin:0;padding:0;display:inline"><input name="utf8" type="hidden" value="✓" /><input name="_method" type="hidden" value="put" /></div><table class='table table-bordered table-compressed'>
|
14
|
+
<thead>
|
15
|
+
<tr>
|
16
|
+
<th>Label</th>
|
17
|
+
<th>File Name</th>
|
18
|
+
<th>Content Type</th>
|
19
|
+
<th>Uploaded At</th>
|
20
|
+
<th>Public</th>
|
21
|
+
<th></th>
|
22
|
+
<th></th>
|
23
|
+
</tr>
|
24
|
+
</thead>
|
25
|
+
<tbody>
|
26
|
+
<tr>
|
27
|
+
<td><input id="account_modulate_documents_attributes_0_label" name="account[modulate_documents_attributes][0][label]" size="30" type="text" value="Test" /></td>
|
28
|
+
<td>test.txt</td>
|
29
|
+
<td>text/plain</td>
|
30
|
+
<td>Thu, 30 May 2013 16:51:34 +0000</td>
|
31
|
+
<td><input name="account[modulate_documents_attributes][0][public]" type="hidden" value="0" /><input id="account_modulate_documents_attributes_0_public" name="account[modulate_documents_attributes][0][public]" type="checkbox" value="1" /></td>
|
32
|
+
<td>
|
33
|
+
<a href="/modulate/documents/87" rel="tooltip" title="Download"><i class='icon-download'></i>
|
34
|
+
</a></td>
|
35
|
+
<td>
|
36
|
+
<a href="/modulate/documents/87" data-confirm="Are you sure?" data-method="delete" rel="tooltip" title="Delete"><i class='icon-remove-circle'></i>
|
37
|
+
</a></td>
|
38
|
+
</tr>
|
39
|
+
<input id="account_modulate_documents_attributes_0_id" name="account[modulate_documents_attributes][0][id]" type="hidden" value="87" /></tbody>
|
40
|
+
</table>
|
41
|
+
|
42
|
+
<fieldset class="inputs"><ol><li class="file input required" id="account_modulate_uploads_attributes_0_attachment_input"><label class=" label" for="account_modulate_uploads_attributes_0_attachment">Choose document to attach<abbr title="required">*</abbr></label><input id="account_modulate_uploads_attributes_0_attachment" multiple="multiple" name="account[modulate_uploads_attributes][][attachment]" type="file" />
|
43
|
+
|
44
|
+
</li>
|
45
|
+
</ol></fieldset><fieldset class="actions"><ol><li class="action button_action " id="account_submit_action"><button class="btn btn-primary" name="button" type="submit">Update Account</button></li>
|
46
|
+
<li class="action link_action " id="account_cancel_action"><a href="javascript:history.back()">Cancel</a></li>
|
47
|
+
</ol></fieldset></form>
|
48
|
+
|
49
|
+
|
50
|
+
|
51
|
+
|
52
|
+
</body>
|
53
|
+
</html>
|
@@ -0,0 +1,53 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<title>Dummy</title>
|
5
|
+
<link href="/assets/application.css" media="all" rel="stylesheet" type="text/css" />
|
6
|
+
<script src="/assets/application.js" type="text/javascript"></script>
|
7
|
+
|
8
|
+
</head>
|
9
|
+
<body>
|
10
|
+
|
11
|
+
|
12
|
+
|
13
|
+
<form accept-charset="UTF-8" action="/accounts/121" class="formtastic account" enctype="multipart/form-data" id="edit_account_121" method="post" novalidate="novalidate"><div style="margin:0;padding:0;display:inline"><input name="utf8" type="hidden" value="✓" /><input name="_method" type="hidden" value="put" /></div><table class='table table-bordered table-compressed'>
|
14
|
+
<thead>
|
15
|
+
<tr>
|
16
|
+
<th>Label</th>
|
17
|
+
<th>File Name</th>
|
18
|
+
<th>Content Type</th>
|
19
|
+
<th>Uploaded At</th>
|
20
|
+
<th>Public</th>
|
21
|
+
<th></th>
|
22
|
+
<th></th>
|
23
|
+
</tr>
|
24
|
+
</thead>
|
25
|
+
<tbody>
|
26
|
+
<tr>
|
27
|
+
<td><input id="account_modulate_documents_attributes_0_label" name="account[modulate_documents_attributes][0][label]" size="30" type="text" value="Test" /></td>
|
28
|
+
<td>test.txt</td>
|
29
|
+
<td>text/plain</td>
|
30
|
+
<td>Thu, 30 May 2013 16:54:30 +0000</td>
|
31
|
+
<td><input name="account[modulate_documents_attributes][0][public]" type="hidden" value="0" /><input id="account_modulate_documents_attributes_0_public" name="account[modulate_documents_attributes][0][public]" type="checkbox" value="1" /></td>
|
32
|
+
<td>
|
33
|
+
<a href="/modulate/documents/90" rel="tooltip" title="Download"><i class='icon-download'></i>
|
34
|
+
</a></td>
|
35
|
+
<td>
|
36
|
+
<a href="/modulate/documents/90" data-confirm="Are you sure?" data-method="delete" rel="tooltip" title="Delete"><i class='icon-remove-circle'></i>
|
37
|
+
</a></td>
|
38
|
+
</tr>
|
39
|
+
<input id="account_modulate_documents_attributes_0_id" name="account[modulate_documents_attributes][0][id]" type="hidden" value="90" /></tbody>
|
40
|
+
</table>
|
41
|
+
|
42
|
+
<fieldset class="inputs"><ol><li class="file input required" id="account_modulate_uploads_attributes_0_attachment_input"><label class=" label" for="account_modulate_uploads_attributes_0_attachment">Choose document to attach<abbr title="required">*</abbr></label><input id="account_modulate_uploads_attributes_0_attachment" multiple="multiple" name="account[modulate_uploads_attributes][][attachment]" type="file" />
|
43
|
+
|
44
|
+
</li>
|
45
|
+
</ol></fieldset><fieldset class="actions"><ol><li class="action button_action " id="account_submit_action"><button class="btn btn-primary" name="button" type="submit">Update Account</button></li>
|
46
|
+
<li class="action link_action " id="account_cancel_action"><a href="javascript:history.back()">Cancel</a></li>
|
47
|
+
</ol></fieldset></form>
|
48
|
+
|
49
|
+
|
50
|
+
|
51
|
+
|
52
|
+
</body>
|
53
|
+
</html>
|
@@ -0,0 +1 @@
|
|
1
|
+
This is a test document.
|
@@ -0,0 +1 @@
|
|
1
|
+
This is a test document.
|
@@ -0,0 +1 @@
|
|
1
|
+
This is a test document.
|
@@ -0,0 +1 @@
|
|
1
|
+
This is a test document.
|
@@ -0,0 +1 @@
|
|
1
|
+
[:retrieve_versions_from_store!]
|
@@ -1,21 +1,47 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
|
-
describe "
|
3
|
+
describe "document handling" do
|
4
4
|
|
5
5
|
let(:account) { FactoryGirl.create(:account) }
|
6
6
|
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
7
|
+
describe "uploading a document" do
|
8
|
+
|
9
|
+
before :each do
|
10
|
+
visit "/accounts/#{account.id}"
|
11
|
+
attach_file('account_modulate_uploads_attributes_0_attachment', Rails.root.join('../../', 'spec', 'fixtures', 'test.txt'))
|
12
|
+
click_button "Update Account"
|
13
|
+
end
|
14
|
+
|
15
|
+
it "stores the file to Riak" do
|
16
|
+
expect(page).to have_content('successfully')
|
17
|
+
end
|
18
|
+
|
19
|
+
it "sets the label" do
|
20
|
+
expect(Modulate::Document.last.label).to eq('Test')
|
21
|
+
end
|
22
|
+
|
15
23
|
end
|
16
24
|
|
17
|
-
|
18
|
-
|
25
|
+
describe "downloading a document" do
|
26
|
+
|
27
|
+
before :each do
|
28
|
+
visit "/accounts/#{account.id}"
|
29
|
+
attach_file('account_modulate_uploads_attributes_0_attachment', Rails.root.join('../../', 'spec', 'fixtures', 'test.txt'))
|
30
|
+
click_button "Update Account"
|
31
|
+
|
32
|
+
doc_id = Modulate::Document.last.id
|
33
|
+
visit "/accounts/#{account.id}"
|
34
|
+
visit "/modulate/documents/#{doc_id}"
|
35
|
+
end
|
36
|
+
|
37
|
+
it "downloads the file from Riak" do
|
38
|
+
require 'launchy'
|
39
|
+
puts "hello"
|
40
|
+
save_and_open_page
|
41
|
+
expect(page.response_headers['Content-Type']).to eq("application/octet-stream")
|
42
|
+
end
|
43
|
+
|
19
44
|
end
|
20
45
|
|
21
46
|
end
|
47
|
+
|
data/spec/modulate_spec.rb
CHANGED
@@ -11,8 +11,8 @@ describe Modulate do
|
|
11
11
|
end
|
12
12
|
|
13
13
|
it "adds a relationship to each model that calls it" do
|
14
|
-
Account.should_receive(:has_many).once.with(:modulate_uploads, as: :attachable, class_name: "Modulate::Document")
|
15
|
-
Account.should_receive(:has_many).once.with(:modulate_documents, as: :attachable, class_name: "Modulate::Document")
|
14
|
+
Account.should_receive(:has_many).once.with(:modulate_uploads, as: :attachable, class_name: "Modulate::Document", inverse_of: :attachable)
|
15
|
+
Account.should_receive(:has_many).once.with(:modulate_documents, as: :attachable, class_name: "Modulate::Document", inverse_of: :attachable)
|
16
16
|
Account.modulate
|
17
17
|
end
|
18
18
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: modulate
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.13
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-
|
12
|
+
date: 2013-05-30 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: carrierwave-riak
|
@@ -255,6 +255,9 @@ files:
|
|
255
255
|
- spec/dummy/public/uploads/tmp/20130405-1103-92315-4868/test.txt
|
256
256
|
- spec/dummy/public/uploads/tmp/20130405-1104-92379-0419/test.txt
|
257
257
|
- spec/dummy/public/uploads/tmp/20130405-1354-99705-5773/test.txt
|
258
|
+
- spec/dummy/public/uploads/tmp/20130530-1328-18378-5665/test.txt
|
259
|
+
- spec/dummy/public/uploads/tmp/20130530-1328-18378-7053/test.txt
|
260
|
+
- spec/dummy/public/uploads/tmp/20130530-1328-18378-7409/test.txt
|
258
261
|
- spec/dummy/Rakefile
|
259
262
|
- spec/dummy/README.rdoc
|
260
263
|
- spec/dummy/script/rails
|
@@ -284,6 +287,15 @@ files:
|
|
284
287
|
- spec/dummy/tmp/capybara/capybara-2013040511010831294374.html
|
285
288
|
- spec/dummy/tmp/capybara/capybara-201304051104006370952070.html
|
286
289
|
- spec/dummy/tmp/capybara/capybara-201304051104405983646971.html
|
290
|
+
- spec/dummy/tmp/capybara/capybara-201305301250104386415623.html
|
291
|
+
- spec/dummy/tmp/capybara/capybara-201305301250471031790437.html
|
292
|
+
- spec/dummy/tmp/capybara/capybara-201305301251356698936017.html
|
293
|
+
- spec/dummy/tmp/capybara/capybara-201305301254318405365845.html
|
294
|
+
- spec/dummy/tmp/capybara/capybara-201305301334158549042667.html
|
295
|
+
- spec/dummy/tmp/capybara/capybara-201305301336008526948343.html
|
296
|
+
- spec/dummy/tmp/capybara/capybara-201305301336478327145176.html
|
297
|
+
- spec/dummy/tmp/capybara/capybara-20130530133716805682676.html
|
298
|
+
- spec/dummy/tmp/capybara/capybara-201305301408065641681440.html
|
287
299
|
- spec/dummy/tmp/restart.txt
|
288
300
|
- spec/factories/account_factory.rb
|
289
301
|
- spec/features/modulate_spec.rb
|
@@ -307,7 +319,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
307
319
|
version: '0'
|
308
320
|
segments:
|
309
321
|
- 0
|
310
|
-
hash: -
|
322
|
+
hash: -1688955795783442156
|
311
323
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
312
324
|
none: false
|
313
325
|
requirements:
|
@@ -316,7 +328,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
316
328
|
version: '0'
|
317
329
|
segments:
|
318
330
|
- 0
|
319
|
-
hash: -
|
331
|
+
hash: -1688955795783442156
|
320
332
|
requirements: []
|
321
333
|
rubyforge_project:
|
322
334
|
rubygems_version: 1.8.24
|
@@ -399,6 +411,9 @@ test_files:
|
|
399
411
|
- spec/dummy/public/uploads/tmp/20130405-1103-92315-4868/test.txt
|
400
412
|
- spec/dummy/public/uploads/tmp/20130405-1104-92379-0419/test.txt
|
401
413
|
- spec/dummy/public/uploads/tmp/20130405-1354-99705-5773/test.txt
|
414
|
+
- spec/dummy/public/uploads/tmp/20130530-1328-18378-5665/test.txt
|
415
|
+
- spec/dummy/public/uploads/tmp/20130530-1328-18378-7053/test.txt
|
416
|
+
- spec/dummy/public/uploads/tmp/20130530-1328-18378-7409/test.txt
|
402
417
|
- spec/dummy/Rakefile
|
403
418
|
- spec/dummy/README.rdoc
|
404
419
|
- spec/dummy/script/rails
|
@@ -428,6 +443,15 @@ test_files:
|
|
428
443
|
- spec/dummy/tmp/capybara/capybara-2013040511010831294374.html
|
429
444
|
- spec/dummy/tmp/capybara/capybara-201304051104006370952070.html
|
430
445
|
- spec/dummy/tmp/capybara/capybara-201304051104405983646971.html
|
446
|
+
- spec/dummy/tmp/capybara/capybara-201305301250104386415623.html
|
447
|
+
- spec/dummy/tmp/capybara/capybara-201305301250471031790437.html
|
448
|
+
- spec/dummy/tmp/capybara/capybara-201305301251356698936017.html
|
449
|
+
- spec/dummy/tmp/capybara/capybara-201305301254318405365845.html
|
450
|
+
- spec/dummy/tmp/capybara/capybara-201305301334158549042667.html
|
451
|
+
- spec/dummy/tmp/capybara/capybara-201305301336008526948343.html
|
452
|
+
- spec/dummy/tmp/capybara/capybara-201305301336478327145176.html
|
453
|
+
- spec/dummy/tmp/capybara/capybara-20130530133716805682676.html
|
454
|
+
- spec/dummy/tmp/capybara/capybara-201305301408065641681440.html
|
431
455
|
- spec/dummy/tmp/restart.txt
|
432
456
|
- spec/factories/account_factory.rb
|
433
457
|
- spec/features/modulate_spec.rb
|