radiant-images-extension 0.3.3 → 0.3.4
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/README.md +60 -23
- data/Rakefile +2 -1
- data/VERSION +1 -1
- data/app/controllers/admin/images_controller.rb +5 -19
- data/app/models/image.rb +15 -60
- data/app/views/admin/images/_bottom.haml +1 -6
- data/config/routes.rb +1 -1
- data/images_extension.rb +8 -12
- data/lib/images/interface/admin/images.rb +1 -2
- data/lib/images/tags/core.rb +16 -223
- data/public/stylesheets/sass/admin/extensions/images/index.sass +4 -0
- data/radiant-images-extension.gemspec +9 -7
- data/spec/controllers/admin/images_controller_spec.rb +88 -31
- data/spec/datasets/images.rb +1 -1
- data/spec/datasets/squaretalent.png +0 -0
- data/spec/lib/images/tags/core_spec.rb +190 -72
- data/spec/models/image_spec.rb +25 -20
- metadata +33 -19
- data/CHANGELOG +0 -9
- data/public/javascripts/admin/extensions/images/edit.js +0 -0
data/spec/models/image_spec.rb
CHANGED
@@ -3,32 +3,41 @@ require 'spec_helper'
|
|
3
3
|
describe Image do
|
4
4
|
dataset :images
|
5
5
|
|
6
|
-
before
|
6
|
+
before :each do
|
7
7
|
stub(AWS::S3::Base).establish_connection!
|
8
|
-
@image = images(:
|
8
|
+
@image = images(:second)
|
9
9
|
end
|
10
10
|
|
11
|
-
|
12
|
-
|
13
|
-
|
11
|
+
context 'fields' do
|
12
|
+
|
13
|
+
it 'should have a title' do
|
14
|
+
@image.title.should == 'second'
|
15
|
+
end
|
14
16
|
|
15
|
-
|
16
|
-
|
17
|
+
it 'should have a caption' do
|
18
|
+
@image.caption.should == "caption for second"
|
19
|
+
end
|
20
|
+
|
17
21
|
end
|
18
22
|
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
+
context 'validations' do
|
24
|
+
|
25
|
+
it 'should require a unique title' do
|
26
|
+
@new_image = @image.clone
|
27
|
+
@new_image.valid?
|
28
|
+
@new_image.errors.on(:title).should include 'name is already in use'
|
29
|
+
end
|
30
|
+
|
23
31
|
end
|
24
32
|
|
25
33
|
context 's3 assets' do
|
34
|
+
|
26
35
|
it 'should have an asset' do
|
27
36
|
@image.asset.class.should == Paperclip::Attachment
|
28
37
|
end
|
29
38
|
|
30
39
|
it 'should have a file_name' do
|
31
|
-
@image.asset_file_name.should == '
|
40
|
+
@image.asset_file_name.should == 'second.png'
|
32
41
|
end
|
33
42
|
|
34
43
|
it 'should have a file_type' do
|
@@ -36,14 +45,13 @@ describe Image do
|
|
36
45
|
end
|
37
46
|
|
38
47
|
it 'should have a file_size' do
|
39
|
-
@image.asset_file_size.should == "
|
48
|
+
@image.asset_file_size.should == "1001"
|
40
49
|
end
|
41
50
|
|
42
51
|
it 'should require a valid asset' do
|
43
52
|
# create an invalid image without an asset!
|
44
53
|
image = Image.new
|
45
|
-
image.
|
46
|
-
image.errors.on(:asset).should include 'must be set'
|
54
|
+
image.should_not be_valid
|
47
55
|
end
|
48
56
|
|
49
57
|
it 'should require a unique filename' do
|
@@ -54,12 +62,9 @@ describe Image do
|
|
54
62
|
|
55
63
|
it 'should only allow image content types' do
|
56
64
|
@image.asset_content_type = 'not/image'
|
57
|
-
@image.
|
58
|
-
@image.errors.on(:asset).should include 'not one of the allowed file types'
|
65
|
+
@image.should_not be_valid
|
59
66
|
end
|
60
67
|
|
61
|
-
|
62
68
|
end
|
63
|
-
|
64
|
-
|
69
|
+
|
65
70
|
end
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: radiant-images-extension
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 27
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 3
|
9
|
-
-
|
10
|
-
version: 0.3.
|
9
|
+
- 4
|
10
|
+
version: 0.3.4
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- squaretalent
|
@@ -15,30 +15,45 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2010-
|
18
|
+
date: 2010-11-02 00:00:00 +08:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
24
|
version_requirements: &id001 !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ">="
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
hash: 57
|
30
|
+
segments:
|
31
|
+
- 0
|
32
|
+
- 9
|
33
|
+
- 1
|
34
|
+
version: 0.9.1
|
35
|
+
name: radiant
|
36
|
+
requirement: *id001
|
37
|
+
- !ruby/object:Gem::Dependency
|
38
|
+
type: :runtime
|
39
|
+
prerelease: false
|
40
|
+
version_requirements: &id002 !ruby/object:Gem::Requirement
|
25
41
|
none: false
|
26
42
|
requirements:
|
27
43
|
- - ~>
|
28
44
|
- !ruby/object:Gem::Version
|
29
|
-
hash:
|
45
|
+
hash: 9
|
30
46
|
segments:
|
31
47
|
- 2
|
32
48
|
- 3
|
33
|
-
-
|
34
|
-
|
35
|
-
version: 2.3.1.1
|
49
|
+
- 5
|
50
|
+
version: 2.3.5
|
36
51
|
name: paperclip
|
37
|
-
requirement: *
|
52
|
+
requirement: *id002
|
38
53
|
- !ruby/object:Gem::Dependency
|
39
54
|
type: :runtime
|
40
55
|
prerelease: false
|
41
|
-
version_requirements: &
|
56
|
+
version_requirements: &id003 !ruby/object:Gem::Requirement
|
42
57
|
none: false
|
43
58
|
requirements:
|
44
59
|
- - ">="
|
@@ -50,11 +65,11 @@ dependencies:
|
|
50
65
|
- 2
|
51
66
|
version: 0.6.2
|
52
67
|
name: aws-s3
|
53
|
-
requirement: *
|
68
|
+
requirement: *id003
|
54
69
|
- !ruby/object:Gem::Dependency
|
55
70
|
type: :runtime
|
56
71
|
prerelease: false
|
57
|
-
version_requirements: &
|
72
|
+
version_requirements: &id004 !ruby/object:Gem::Requirement
|
58
73
|
none: false
|
59
74
|
requirements:
|
60
75
|
- - ">="
|
@@ -66,11 +81,11 @@ dependencies:
|
|
66
81
|
- 2
|
67
82
|
version: 0.1.2
|
68
83
|
name: acts_as_list
|
69
|
-
requirement: *
|
84
|
+
requirement: *id004
|
70
85
|
- !ruby/object:Gem::Dependency
|
71
86
|
type: :development
|
72
87
|
prerelease: false
|
73
|
-
version_requirements: &
|
88
|
+
version_requirements: &id005 !ruby/object:Gem::Requirement
|
74
89
|
none: false
|
75
90
|
requirements:
|
76
91
|
- - ">="
|
@@ -82,11 +97,11 @@ dependencies:
|
|
82
97
|
- 0
|
83
98
|
version: 1.3.0
|
84
99
|
name: rspec
|
85
|
-
requirement: *
|
100
|
+
requirement: *id005
|
86
101
|
- !ruby/object:Gem::Dependency
|
87
102
|
type: :development
|
88
103
|
prerelease: false
|
89
|
-
version_requirements: &
|
104
|
+
version_requirements: &id006 !ruby/object:Gem::Requirement
|
90
105
|
none: false
|
91
106
|
requirements:
|
92
107
|
- - ">="
|
@@ -98,7 +113,7 @@ dependencies:
|
|
98
113
|
- 0
|
99
114
|
version: 1.0.0
|
100
115
|
name: rr
|
101
|
-
requirement: *
|
116
|
+
requirement: *id006
|
102
117
|
description: Image Radiant Extension management tool, meant only to be useful to pages and extensions that need to require images.
|
103
118
|
email: info@squaretalent.com
|
104
119
|
executables: []
|
@@ -110,7 +125,6 @@ extra_rdoc_files:
|
|
110
125
|
- README.md
|
111
126
|
files:
|
112
127
|
- .gitignore
|
113
|
-
- CHANGELOG
|
114
128
|
- LICENSE
|
115
129
|
- README.md
|
116
130
|
- Rakefile
|
@@ -143,12 +157,12 @@ files:
|
|
143
157
|
- public/images/extensions/images/missing_icon.png
|
144
158
|
- public/images/extensions/images/missing_normal.png
|
145
159
|
- public/images/extensions/images/missing_preview.png
|
146
|
-
- public/javascripts/admin/extensions/images/edit.js
|
147
160
|
- public/stylesheets/sass/admin/extensions/images/edit.sass
|
148
161
|
- public/stylesheets/sass/admin/extensions/images/index.sass
|
149
162
|
- radiant-images-extension.gemspec
|
150
163
|
- spec/controllers/admin/images_controller_spec.rb
|
151
164
|
- spec/datasets/images.rb
|
165
|
+
- spec/datasets/squaretalent.png
|
152
166
|
- spec/lib/images/tags/core_spec.rb
|
153
167
|
- spec/models/image_spec.rb
|
154
168
|
- spec/spec.opts
|
data/CHANGELOG
DELETED
File without changes
|