images 0.0.2 → 0.0.3
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.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/app/assets/javascripts/images.js.erb +20 -3
- data/lib/images/version.rb +1 -1
- data/test/images_test.rb +16 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d4e81d051376d28872a0911d71ba44ae54a87b7c
|
4
|
+
data.tar.gz: 47539708a3282daa74451cae778b19edfd22fd56
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 064a16a1f471adcbf229d011ffa8079fcf370203b66f80087647a7d300ddb30c32aee9f2fd7ad89a6782a8bf0d3d044755e5d86f6e2d9c7eec2466b8d252f08a
|
7
|
+
data.tar.gz: 6361f0df283d439534ffd443aabd09ed8fd84d932cde3d3521d1472ad0bd893d1b3fb4c5128d73265c355c56e0918204068cea799164c34742c2352d80df131e
|
data/Gemfile.lock
CHANGED
@@ -1,4 +1,21 @@
|
|
1
|
-
(function (
|
1
|
+
(function (root, factory) {
|
2
|
+
if (typeof define === 'function' && define.amd) {
|
3
|
+
// AMD. Register as an anonymous module.
|
4
|
+
define(['module'], function (module, b) {
|
5
|
+
factory(module);
|
6
|
+
});
|
7
|
+
} else if (typeof module === 'object' && typeof module.nodeName !== 'string') {
|
8
|
+
// CommonJS
|
9
|
+
factory(module);
|
10
|
+
} else {
|
11
|
+
// Browser globals
|
12
|
+
var _module = { exports: {} };
|
13
|
+
factory(_module);
|
14
|
+
|
15
|
+
root.Images = _module.exports;
|
16
|
+
}
|
17
|
+
}(this, function (module) {
|
18
|
+
|
2
19
|
var Images = <%= Images.generate.to_json %>;
|
3
20
|
|
4
21
|
function deepFreeze (obj) {
|
@@ -17,6 +34,6 @@
|
|
17
34
|
deepFreeze(Images);
|
18
35
|
}
|
19
36
|
|
20
|
-
|
37
|
+
module.exports = Images;
|
21
38
|
|
22
|
-
}
|
39
|
+
}));
|
data/lib/images/version.rb
CHANGED
data/test/images_test.rb
CHANGED
@@ -11,7 +11,6 @@ class ImagesTest < Minitest::Test
|
|
11
11
|
|
12
12
|
def setup
|
13
13
|
FileUtils.rm_rf(Rails.root.join("tmp"))
|
14
|
-
FileUtils.rm_rf(Rails.root.join("teset/dummy/tmp"))
|
15
14
|
Capybara.current_driver = :chrome
|
16
15
|
end
|
17
16
|
|
@@ -38,4 +37,20 @@ class ImagesTest < Minitest::Test
|
|
38
37
|
assert_equal(result, expected)
|
39
38
|
end
|
40
39
|
|
40
|
+
def test_adding_files_to_images_folder
|
41
|
+
image_path = Rails.root.join("app/assets/images/touched.jpg")
|
42
|
+
|
43
|
+
visit "/"
|
44
|
+
result = page.execute_script("return window.Images")
|
45
|
+
assert(result["touched_jpg_path"].nil?)
|
46
|
+
|
47
|
+
FileUtils.touch(image_path)
|
48
|
+
|
49
|
+
visit "/"
|
50
|
+
result = page.execute_script("return window.Images")
|
51
|
+
refute(result["touched_jpg_path"].present?)
|
52
|
+
|
53
|
+
FileUtils.rm_rf(image_path)
|
54
|
+
end
|
55
|
+
|
41
56
|
end
|