refinerycms-images 0.9.9.18 → 0.9.9.19

Sign up to get free protection for your applications and to get access to all the features.
@@ -66,11 +66,16 @@ module Admin
66
66
  render :action => 'new'
67
67
  end
68
68
  else
69
+ # if all uploaded images are ok redirect page back to dialog, else show current page with error
69
70
  if @images.all?{|i| i.valid?}
70
71
  @image_id = @image.id if @image.persisted?
71
72
  @image = nil
73
+
74
+ # please please please
75
+ redirect_to :action => 'insert', :modal => from_dialog?, :wymeditor => from_dialog?, :dialog => from_dialog?
76
+ else
77
+ self.insert
72
78
  end
73
- self.insert
74
79
  end
75
80
  end
76
81
 
@@ -2,10 +2,10 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{refinerycms-images}
5
- s.version = %q{0.9.9.18}
5
+ s.version = %q{0.9.9.19}
6
6
  s.summary = %q{Images engine for Refinery CMS}
7
7
  s.description = %q{Handles all image upload and processing functionality in Refinery CMS.}
8
- s.date = %q{2011-04-16}
8
+ s.date = %q{2011-04-22}
9
9
  s.email = %q{info@refinerycms.com}
10
10
  s.homepage = %q{http://refinerycms.com}
11
11
  s.rubyforge_project = %q{refinerycms}
@@ -94,7 +94,7 @@ Gem::Specification.new do |s|
94
94
  'spec/uploads/beach.jpeg'
95
95
  ]
96
96
 
97
- s.add_dependency 'refinerycms-core', '= 0.9.9.18'
97
+ s.add_dependency 'refinerycms-core', '= 0.9.9.19'
98
98
  s.add_dependency 'dragonfly', '~> 0.8.2'
99
99
  s.add_dependency 'rack-cache', '>= 0.5.3'
100
100
  end
@@ -1,63 +1,43 @@
1
1
  require 'spec_helper'
2
2
 
3
3
  describe Image do
4
-
5
- def reset_image(options = {})
6
- @valid_attributes = {
7
- :id => 1,
8
- :image => File.new(File.expand_path('../../uploads/beach.jpeg', __FILE__))
9
- }.merge(options)
10
-
11
- @image.destroy if @image
12
- @image = Image.create!(@valid_attributes)
13
- end
14
-
15
- def image_can_be_destroyed
16
- @image.destroy.should == true
17
- end
18
-
19
- before(:each) do
20
- reset_image
21
- end
22
-
23
- # clean up after ourselves.
24
- after(:each) do
25
- Image.destroy_all
4
+ let(:image) do
5
+ Image.create!(:id => 1,
6
+ :image => File.new(File.expand_path('../../uploads/beach.jpeg', __FILE__)))
26
7
  end
27
8
 
28
9
  context "with valid attributes" do
29
10
  it "should create successfully" do
30
- @image.errors.empty?
11
+ image.errors.should be_empty
31
12
  end
32
13
  end
33
14
 
34
15
  context "image url" do
35
16
  it "should respond to .thumbnail" do
36
- @image.respond_to?(:thumbnail).should == true
17
+ image.should respond_to(:thumbnail)
37
18
  end
38
19
 
39
20
  it "should contain its filename at the end" do
40
- @image.thumbnail(nil).url.split('/').last.should == @image.image_name
21
+ image.thumbnail(nil).url.split('/').last.should == image.image_name
41
22
  end
42
23
 
43
24
  it "should be different when supplying geometry" do
44
- @image.thumbnail(nil).url.should_not == @image.thumbnail('200x200').url
25
+ image.thumbnail(nil).url.should_not == image.thumbnail('200x200').url
45
26
  end
46
27
 
47
28
  it "should have different urls for each geometry string" do
48
- @image.thumbnail('200x200').url.should_not == @image.thumbnail('200x201').url
29
+ image.thumbnail('200x200').url.should_not == image.thumbnail('200x201').url
49
30
  end
50
31
 
51
32
  it "should use right geometry when given a thumbnail name" do
52
33
  name, geometry = Image.user_image_sizes.first
53
- @image.thumbnail(name).url.should == @image.thumbnail(geometry).url
34
+ image.thumbnail(name).url.should == image.thumbnail(geometry).url
54
35
  end
55
-
56
36
  end
57
37
 
58
38
  describe "#title" do
59
39
  it "returns a titleized version of the filename" do
60
- @image.title.should == "Beach"
40
+ image.title.should == "Beach"
61
41
  end
62
42
  end
63
43
 
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: refinerycms-images
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.9.9.18
5
+ version: 0.9.9.19
6
6
  platform: ruby
7
7
  authors:
8
8
  - Resolve Digital
@@ -13,7 +13,7 @@ autorequire:
13
13
  bindir: bin
14
14
  cert_chain: []
15
15
 
16
- date: 2011-04-16 00:00:00 Z
16
+ date: 2011-04-22 00:00:00 Z
17
17
  dependencies:
18
18
  - !ruby/object:Gem::Dependency
19
19
  name: refinerycms-core
@@ -23,7 +23,7 @@ dependencies:
23
23
  requirements:
24
24
  - - "="
25
25
  - !ruby/object:Gem::Version
26
- version: 0.9.9.18
26
+ version: 0.9.9.19
27
27
  type: :runtime
28
28
  version_requirements: *id001
29
29
  - !ruby/object:Gem::Dependency