Skip to content
Browse files

patch paperclip support into Rack::Test::UploadedFile, bundler doesn'…

…t support different versions of same by platform so using RUBY_VERSION conditional
  • Loading branch information...
1 parent 6ba225e commit 79432e7ec7e3fd3a7535cd7cac0c831570ae848f @warp warp committed Apr 6, 2012
Showing with 10 additions and 9 deletions.
  1. +6 −3 Gemfile
  2. +0 −1 Gemfile.lock
  3. +1 −5 spec/controllers/users_controller_spec.rb
  4. +3 −0 spec/support/uploaded_file.rb
View
9 Gemfile
@@ -51,9 +51,12 @@ group :test do
gem 'spork'
gem 'database_cleaner'
gem 'fuubar'
- gem 'factory_girl'
- gem 'factory_girl_rails', '~> 1.7.0', :platform => :mri_18
- gem 'factory_girl_rails', '~> 3.0.0', :platform => :mri_19
+
+ if RUBY_VERSION.to_f >= 1.9
+ gem 'factory_girl_rails', '~> 3.0.0'
+ else
+ gem 'factory_girl_rails', '~> 1.7.0'
+ end
end
group :heroku do
View
1 Gemfile.lock
@@ -268,7 +268,6 @@ DEPENDENCIES
debugger
dynamic_form
email_reply_parser!
- factory_girl
factory_girl_rails (~> 3.0.0)
ffaker (>= 1.12.0)
fuubar
View
6 spec/controllers/users_controller_spec.rb
@@ -152,7 +152,6 @@
response.should render_template("users/new")
end
end
-
end
# PUT /users/1
@@ -173,7 +172,6 @@
assigns[:user].should == @user
response.should render_template("users/update")
end
-
end
describe "with invalid params" do
@@ -184,9 +182,7 @@
assigns[:user].should == @user
response.should render_template("users/update")
end
-
end
-
end
# DELETE /users/1
@@ -247,7 +243,7 @@
end
it "should save the user avatar if it was successfully uploaded and resized" do
- @image = fixture_file_upload("/rails.png", "image/png")
+ @image = fixture_file_upload('/rails.png', 'image/png')
xhr :put, :upload_avatar, :id => @user.id, :avatar => { :image => @image }
@user.avatar.should_not == nil
View
3 spec/support/uploaded_file.rb
@@ -0,0 +1,3 @@
+Rack::Test::UploadedFile.class_eval do
+ attr_acessor :tempfile
+end

0 comments on commit 79432e7

Please sign in to comment.
Something went wrong with that request. Please try again.