Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
P
paperclip
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
ikcrm_common
paperclip
Commits
af689b44
Commit
af689b44
authored
13 years ago
by
Mike Burns
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix the fixture issue.
parent
093a14ad
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
67 additions
and
63 deletions
+67
-63
gemfiles/rails2.gemfile
+14
-14
gemfiles/rails3.gemfile
+14
-14
gemfiles/rails3_1.gemfile
+14
-14
test/helper.rb
+4
-0
test/storage/filesystem_test.rb
+2
-2
test/storage/fog_test.rb
+7
-7
test/storage/s3_live_test.rb
+2
-2
test/storage/s3_test.rb
+10
-10
No files found.
gemfiles/rails2.gemfile
View file @
af689b44
...
...
@@ -2,24 +2,24 @@
source "http://rubygems.org"
gem "sqlite3", "~>1.3.4"
gem "fakeweb", :require=>false
gem "rails", "~> 2.3.14"
gem "activerecord", :require=>"active_record"
gem "appraisal"
gem "aruba"
gem "aws-s3", :require=>"aws/s3"
gem "bundler"
gem "pry"
gem "cocaine", "~>0.2"
gem "
fog
"
gem "
jruby-openssl", :platform=>:jruby
gem "
rake
"
gem "
shoulda"
gem "mime-types"
gem "aruba"
gem "jruby-openssl", :platform=>:jruby
gem "paperclip", :path=>"../"
gem "mocha"
gem "rake"
gem "bundler"
gem "fog"
gem "cucumber", "~> 1.0.0"
gem "appraisal"
gem "aws-s3", :require=>"aws/s3"
gem "rdoc", :require=>false
gem "capybara"
gem "cucumber", "~> 1.0.0"
gem "shoulda"
gem "sqlite3", "~>1.3.4"
gem "fakeweb", :require=>false
gem "pry"
gem "rails", "~> 2.3.14"
gem "paperclip", :path=>"../"
This diff is collapsed.
Click to expand it.
gemfiles/rails3.gemfile
View file @
af689b44
...
...
@@ -2,24 +2,24 @@
source "http://rubygems.org"
gem "sqlite3", "~>1.3.4"
gem "fakeweb", :require=>false
gem "rails", "~> 3.0.10"
gem "activerecord", :require=>"active_record"
gem "appraisal"
gem "aruba"
gem "aws-s3", :require=>"aws/s3"
gem "bundler"
gem "pry"
gem "cocaine", "~>0.2"
gem "
fog
"
gem "
jruby-openssl", :platform=>:jruby
gem "
rake
"
gem "
shoulda"
gem "mime-types"
gem "aruba"
gem "jruby-openssl", :platform=>:jruby
gem "paperclip", :path=>"../"
gem "mocha"
gem "rake"
gem "bundler"
gem "fog"
gem "cucumber", "~> 1.0.0"
gem "appraisal"
gem "aws-s3", :require=>"aws/s3"
gem "rdoc", :require=>false
gem "capybara"
gem "cucumber", "~> 1.0.0"
gem "shoulda"
gem "sqlite3", "~>1.3.4"
gem "fakeweb", :require=>false
gem "pry"
gem "rails", "~> 3.0.10"
gem "paperclip", :path=>"../"
This diff is collapsed.
Click to expand it.
gemfiles/rails3_1.gemfile
View file @
af689b44
...
...
@@ -2,24 +2,24 @@
source "http://rubygems.org"
gem "sqlite3", "~>1.3.4"
gem "fakeweb", :require=>false
gem "rails", "~> 3.1.0"
gem "activerecord", :require=>"active_record"
gem "appraisal"
gem "aruba"
gem "aws-s3", :require=>"aws/s3"
gem "bundler"
gem "pry"
gem "cocaine", "~>0.2"
gem "
fog
"
gem "
jruby-openssl", :platform=>:jruby
gem "
rake
"
gem "
shoulda"
gem "mime-types"
gem "aruba"
gem "jruby-openssl", :platform=>:jruby
gem "paperclip", :path=>"../"
gem "mocha"
gem "rake"
gem "bundler"
gem "fog"
gem "cucumber", "~> 1.0.0"
gem "appraisal"
gem "aws-s3", :require=>"aws/s3"
gem "rdoc", :require=>false
gem "capybara"
gem "cucumber", "~> 1.0.0"
gem "shoulda"
gem "sqlite3", "~>1.3.4"
gem "fakeweb", :require=>false
gem "pry"
gem "rails", "~> 3.1.0"
gem "paperclip", :path=>"../"
This diff is collapsed.
Click to expand it.
test/helper.rb
View file @
af689b44
...
...
@@ -152,3 +152,7 @@ def with_exitstatus_returning(code)
`ruby -e 'exit
#{
saved_exitstatus
.
to_i
}
'`
end
end
def
fixture_file
(
filename
)
File
.
join
(
File
.
dirname
(
__FILE__
),
'fixtures'
,
filename
)
end
This diff is collapsed.
Click to expand it.
test/storage/filesystem_test.rb
View file @
af689b44
...
...
@@ -6,7 +6,7 @@ class FileSystemTest < Test::Unit::TestCase
rebuild_model
:styles
=>
{
:thumbnail
=>
"25x25#"
}
@dummy
=
Dummy
.
create!
@dummy
.
avatar
=
File
.
open
(
File
.
join
(
File
.
dirname
(
__FILE__
),
".."
,
"fixtures"
,
"5k.png"
))
@dummy
.
avatar
=
File
.
open
(
fixture_file
(
'5k.png'
))
end
should
"allow file assignment"
do
...
...
@@ -36,7 +36,7 @@ class FileSystemTest < Test::Unit::TestCase
rebuild_model
:styles
=>
{
:thumbnail
=>
"25x25#"
}
@dummy
=
Dummy
.
create!
@dummy
.
avatar
=
File
.
open
(
File
.
join
(
File
.
dirname
(
__FILE__
),
".."
,
"fixtures"
,
"spaced file.png"
))
@dummy
.
avatar
=
File
.
open
(
fixture_file
(
'spaced file.png'
))
@dummy
.
save
end
...
...
This diff is collapsed.
Click to expand it.
test/storage/fog_test.rb
View file @
af689b44
...
...
@@ -12,9 +12,9 @@ class FogTest < Test::Unit::TestCase
:storage
=>
:fog
,
:url
=>
'/:attachment/:filename'
,
:fog_directory
=>
"paperclip"
,
:fog_credentials
=>
File
.
join
(
File
.
dirname
(
__FILE__
),
'fixtures'
,
'fog.yml'
)
:fog_credentials
=>
fixture_file
(
'fog.yml'
)
@dummy
=
Dummy
.
new
@dummy
.
avatar
=
File
.
new
(
File
.
join
(
File
.
dirname
(
__FILE__
),
'fixtures'
,
'5k.png'
),
'rb'
)
@dummy
.
avatar
=
File
.
new
(
fixture_file
(
'5k.png'
),
'rb'
)
end
should
"have the proper information loading credentials from a file"
do
...
...
@@ -28,9 +28,9 @@ class FogTest < Test::Unit::TestCase
:storage
=>
:fog
,
:url
=>
'/:attachment/:filename'
,
:fog_directory
=>
"paperclip"
,
:fog_credentials
=>
File
.
open
(
File
.
join
(
File
.
dirname
(
__FILE__
),
'fixtures'
,
'fog.yml'
))
:fog_credentials
=>
File
.
open
(
fixture_file
(
'fog.yml'
))
@dummy
=
Dummy
.
new
@dummy
.
avatar
=
File
.
new
(
File
.
join
(
File
.
dirname
(
__FILE__
),
'fixtures'
,
'5k.png'
),
'rb'
)
@dummy
.
avatar
=
File
.
new
(
fixture_file
(
'5k.png'
),
'rb'
)
end
should
"have the proper information loading credentials from a file"
do
...
...
@@ -50,10 +50,10 @@ class FogTest < Test::Unit::TestCase
:aws_secret_access_key
=>
'AWS_SECRET'
}
@dummy
=
Dummy
.
new
@dummy
.
avatar
=
File
.
new
(
File
.
join
(
File
.
dirname
(
__FILE__
),
'fixtures'
,
'5k.png'
),
'rb'
)
@dummy
.
avatar
=
File
.
new
(
fixture_file
(
'5k.png'
),
'rb'
)
end
should
"be able to interpolate the path without blowing up"
do
assert_equal
File
.
expand_path
(
File
.
join
(
File
.
dirname
(
__FILE__
),
"../public/avatars/5k.png"
)),
assert_equal
File
.
expand_path
(
File
.
join
(
File
.
dirname
(
__FILE__
),
"../
../
public/avatars/5k.png"
)),
@dummy
.
avatar
.
path
end
...
...
@@ -98,7 +98,7 @@ class FogTest < Test::Unit::TestCase
context
"when assigned"
do
setup
do
@file
=
File
.
new
(
File
.
join
(
File
.
dirname
(
__FILE__
),
'fixtures'
,
'5k.png'
),
'rb'
)
@file
=
File
.
new
(
fixture_file
(
'5k.png'
),
'rb'
)
@dummy
=
Dummy
.
new
@dummy
.
avatar
=
@file
end
...
...
This diff is collapsed.
Click to expand it.
test/storage/s3_live_test.rb
View file @
af689b44
...
...
@@ -21,7 +21,7 @@ unless ENV["S3_TEST_BUCKET"].blank?
context
"when assigned"
do
setup
do
@file
=
File
.
new
(
File
.
join
(
File
.
dirname
(
__FILE__
),
'..'
,
'fixtures'
,
'5k.png'
),
'rb'
)
@file
=
File
.
new
(
fixture_file
(
'5k.png'
),
'rb'
)
@dummy
.
avatar
=
@file
end
...
...
@@ -60,7 +60,7 @@ unless ENV["S3_TEST_BUCKET"].blank?
Dummy
.
delete_all
@dummy
=
Dummy
.
new
@dummy
.
avatar
=
File
.
new
(
File
.
join
(
File
.
dirname
(
__FILE__
),
'..'
,
'fixtures'
,
'spaced file.png'
),
'rb'
)
@dummy
.
avatar
=
File
.
new
(
fixture_file
(
'spaced file.png'
),
'rb'
)
@dummy
.
save
end
...
...
This diff is collapsed.
Click to expand it.
test/storage/s3_test.rb
View file @
af689b44
...
...
@@ -98,7 +98,7 @@ class S3Test < Test::Unit::TestCase
}
@dummy
=
Dummy
.
new
@dummy
.
avatar
=
File
.
new
(
File
.
join
(
File
.
dirname
(
__FILE__
),
'..'
,
'fixtures'
,
'5k.png'
),
'rb'
)
@dummy
.
avatar
=
File
.
new
(
fixture_file
(
'5k.png'
),
'rb'
)
end
should
"return a url containing the correct original file mime type"
do
...
...
@@ -122,7 +122,7 @@ class S3Test < Test::Unit::TestCase
}
@dummy
=
Dummy
.
new
@dummy
.
avatar
=
File
.
new
(
File
.
join
(
File
.
dirname
(
__FILE__
),
'..'
,
'fixtures'
,
'spaced file.png'
),
'rb'
)
@dummy
.
avatar
=
File
.
new
(
fixture_file
(
'spaced file.png'
),
'rb'
)
end
should
"return an unescaped version for path"
do
...
...
@@ -346,7 +346,7 @@ class S3Test < Test::Unit::TestCase
context
"when assigned"
do
setup
do
@file
=
File
.
new
(
File
.
join
(
File
.
dirname
(
__FILE__
),
'..'
,
'fixtures'
,
'5k.png'
),
'rb'
)
@file
=
File
.
new
(
fixture_file
(
'5k.png'
),
'rb'
)
@dummy
=
Dummy
.
new
@dummy
.
avatar
=
@file
end
...
...
@@ -437,7 +437,7 @@ class S3Test < Test::Unit::TestCase
context
"when assigned"
do
setup
do
@file
=
File
.
new
(
File
.
join
(
File
.
dirname
(
__FILE__
),
'..'
,
'fixtures'
,
'5k.png'
),
'rb'
)
@file
=
File
.
new
(
fixture_file
(
'5k.png'
),
'rb'
)
@dummy
=
Dummy
.
new
@dummy
.
avatar
=
@file
end
...
...
@@ -472,7 +472,7 @@ class S3Test < Test::Unit::TestCase
rails_env
(
'test'
)
rebuild_model
:storage
=>
:s3
,
:s3_credentials
=>
Pathname
.
new
(
File
.
join
(
File
.
dirname
(
__FILE__
))).
join
(
"../fixtures/s3.yml"
)
:s3_credentials
=>
Pathname
.
new
(
fixture_file
(
's3.yml'
)
)
Dummy
.
delete_all
@dummy
=
Dummy
.
new
...
...
@@ -495,7 +495,7 @@ class S3Test < Test::Unit::TestCase
rails_env
(
'test'
)
rebuild_model
:storage
=>
:s3
,
:s3_credentials
=>
File
.
new
(
File
.
join
(
File
.
dirname
(
__FILE__
),
"../fixtures/s3.yml"
))
:s3_credentials
=>
File
.
new
(
fixture_file
(
's3.yml'
))
Dummy
.
delete_all
...
...
@@ -524,7 +524,7 @@ class S3Test < Test::Unit::TestCase
context
"when assigned"
do
setup
do
@file
=
File
.
new
(
File
.
join
(
File
.
dirname
(
__FILE__
),
'..'
,
'fixtures'
,
'5k.png'
),
'rb'
)
@file
=
File
.
new
(
fixture_file
(
'5k.png'
),
'rb'
)
@dummy
=
Dummy
.
new
@dummy
.
avatar
=
@file
end
...
...
@@ -563,7 +563,7 @@ class S3Test < Test::Unit::TestCase
context
"when assigned"
do
setup
do
@file
=
File
.
new
(
File
.
join
(
File
.
dirname
(
__FILE__
),
'..'
,
'fixtures'
,
'5k.png'
),
'rb'
)
@file
=
File
.
new
(
fixture_file
(
'5k.png'
),
'rb'
)
@dummy
=
Dummy
.
new
@dummy
.
avatar
=
@file
end
...
...
@@ -608,7 +608,7 @@ class S3Test < Test::Unit::TestCase
context
"when assigned"
do
setup
do
@file
=
File
.
new
(
File
.
join
(
File
.
dirname
(
__FILE__
),
'..'
,
'fixtures'
,
'5k.png'
),
'rb'
)
@file
=
File
.
new
(
fixture_file
(
'5k.png'
),
'rb'
)
@dummy
=
Dummy
.
new
@dummy
.
avatar
=
@file
end
...
...
@@ -656,7 +656,7 @@ class S3Test < Test::Unit::TestCase
context
"when assigned"
do
setup
do
@file
=
File
.
new
(
File
.
join
(
File
.
dirname
(
__FILE__
),
'..'
,
'fixtures'
,
'5k.png'
),
'rb'
)
@file
=
File
.
new
(
fixture_file
(
'5k.png'
),
'rb'
)
@dummy
=
Dummy
.
new
@dummy
.
stubs
(
:private_attachment?
=>
true
)
@dummy
.
avatar
=
@file
...
...
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment