Commit af689b44 by Mike Burns

Fix the fixture issue.

parent 093a14ad
...@@ -2,24 +2,24 @@ ...@@ -2,24 +2,24 @@
source "http://rubygems.org" source "http://rubygems.org"
gem "sqlite3", "~>1.3.4"
gem "fakeweb", :require=>false
gem "rails", "~> 2.3.14"
gem "activerecord", :require=>"active_record" gem "activerecord", :require=>"active_record"
gem "appraisal" gem "pry"
gem "aruba"
gem "aws-s3", :require=>"aws/s3"
gem "bundler"
gem "cocaine", "~>0.2" gem "cocaine", "~>0.2"
gem "fog" gem "rake"
gem "jruby-openssl", :platform=>:jruby gem "shoulda"
gem "mime-types" gem "mime-types"
gem "aruba"
gem "jruby-openssl", :platform=>:jruby
gem "paperclip", :path=>"../"
gem "mocha" 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 "rdoc", :require=>false
gem "capybara" 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=>"../"
...@@ -2,24 +2,24 @@ ...@@ -2,24 +2,24 @@
source "http://rubygems.org" source "http://rubygems.org"
gem "sqlite3", "~>1.3.4"
gem "fakeweb", :require=>false
gem "rails", "~> 3.0.10"
gem "activerecord", :require=>"active_record" gem "activerecord", :require=>"active_record"
gem "appraisal" gem "pry"
gem "aruba"
gem "aws-s3", :require=>"aws/s3"
gem "bundler"
gem "cocaine", "~>0.2" gem "cocaine", "~>0.2"
gem "fog" gem "rake"
gem "jruby-openssl", :platform=>:jruby gem "shoulda"
gem "mime-types" gem "mime-types"
gem "aruba"
gem "jruby-openssl", :platform=>:jruby
gem "paperclip", :path=>"../"
gem "mocha" 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 "rdoc", :require=>false
gem "capybara" 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=>"../"
...@@ -2,24 +2,24 @@ ...@@ -2,24 +2,24 @@
source "http://rubygems.org" source "http://rubygems.org"
gem "sqlite3", "~>1.3.4"
gem "fakeweb", :require=>false
gem "rails", "~> 3.1.0"
gem "activerecord", :require=>"active_record" gem "activerecord", :require=>"active_record"
gem "appraisal" gem "pry"
gem "aruba"
gem "aws-s3", :require=>"aws/s3"
gem "bundler"
gem "cocaine", "~>0.2" gem "cocaine", "~>0.2"
gem "fog" gem "rake"
gem "jruby-openssl", :platform=>:jruby gem "shoulda"
gem "mime-types" gem "mime-types"
gem "aruba"
gem "jruby-openssl", :platform=>:jruby
gem "paperclip", :path=>"../"
gem "mocha" 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 "rdoc", :require=>false
gem "capybara" 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=>"../"
...@@ -152,3 +152,7 @@ def with_exitstatus_returning(code) ...@@ -152,3 +152,7 @@ def with_exitstatus_returning(code)
`ruby -e 'exit #{saved_exitstatus.to_i}'` `ruby -e 'exit #{saved_exitstatus.to_i}'`
end end
end end
def fixture_file(filename)
File.join(File.dirname(__FILE__), 'fixtures', filename)
end
...@@ -6,7 +6,7 @@ class FileSystemTest < Test::Unit::TestCase ...@@ -6,7 +6,7 @@ class FileSystemTest < Test::Unit::TestCase
rebuild_model :styles => { :thumbnail => "25x25#" } rebuild_model :styles => { :thumbnail => "25x25#" }
@dummy = Dummy.create! @dummy = Dummy.create!
@dummy.avatar = File.open(File.join(File.dirname(__FILE__), "..", "fixtures", "5k.png")) @dummy.avatar = File.open(fixture_file('5k.png'))
end end
should "allow file assignment" do should "allow file assignment" do
...@@ -36,7 +36,7 @@ class FileSystemTest < Test::Unit::TestCase ...@@ -36,7 +36,7 @@ class FileSystemTest < Test::Unit::TestCase
rebuild_model :styles => { :thumbnail => "25x25#" } rebuild_model :styles => { :thumbnail => "25x25#" }
@dummy = Dummy.create! @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 @dummy.save
end end
......
...@@ -12,9 +12,9 @@ class FogTest < Test::Unit::TestCase ...@@ -12,9 +12,9 @@ class FogTest < Test::Unit::TestCase
:storage => :fog, :storage => :fog,
:url => '/:attachment/:filename', :url => '/:attachment/:filename',
:fog_directory => "paperclip", :fog_directory => "paperclip",
:fog_credentials => File.join(File.dirname(__FILE__), 'fixtures', 'fog.yml') :fog_credentials => fixture_file('fog.yml')
@dummy = Dummy.new @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 end
should "have the proper information loading credentials from a file" do should "have the proper information loading credentials from a file" do
...@@ -28,9 +28,9 @@ class FogTest < Test::Unit::TestCase ...@@ -28,9 +28,9 @@ class FogTest < Test::Unit::TestCase
:storage => :fog, :storage => :fog,
:url => '/:attachment/:filename', :url => '/:attachment/:filename',
:fog_directory => "paperclip", :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 = 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 end
should "have the proper information loading credentials from a file" do should "have the proper information loading credentials from a file" do
...@@ -50,10 +50,10 @@ class FogTest < Test::Unit::TestCase ...@@ -50,10 +50,10 @@ class FogTest < Test::Unit::TestCase
:aws_secret_access_key => 'AWS_SECRET' :aws_secret_access_key => 'AWS_SECRET'
} }
@dummy = Dummy.new @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 end
should "be able to interpolate the path without blowing up" do 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 @dummy.avatar.path
end end
...@@ -98,7 +98,7 @@ class FogTest < Test::Unit::TestCase ...@@ -98,7 +98,7 @@ class FogTest < Test::Unit::TestCase
context "when assigned" do context "when assigned" do
setup 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 = Dummy.new
@dummy.avatar = @file @dummy.avatar = @file
end end
......
...@@ -21,7 +21,7 @@ unless ENV["S3_TEST_BUCKET"].blank? ...@@ -21,7 +21,7 @@ unless ENV["S3_TEST_BUCKET"].blank?
context "when assigned" do context "when assigned" do
setup 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 @dummy.avatar = @file
end end
...@@ -60,7 +60,7 @@ unless ENV["S3_TEST_BUCKET"].blank? ...@@ -60,7 +60,7 @@ unless ENV["S3_TEST_BUCKET"].blank?
Dummy.delete_all Dummy.delete_all
@dummy = Dummy.new @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 @dummy.save
end end
......
...@@ -98,7 +98,7 @@ class S3Test < Test::Unit::TestCase ...@@ -98,7 +98,7 @@ class S3Test < Test::Unit::TestCase
} }
@dummy = Dummy.new @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 end
should "return a url containing the correct original file mime type" do should "return a url containing the correct original file mime type" do
...@@ -122,7 +122,7 @@ class S3Test < Test::Unit::TestCase ...@@ -122,7 +122,7 @@ class S3Test < Test::Unit::TestCase
} }
@dummy = Dummy.new @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 end
should "return an unescaped version for path" do should "return an unescaped version for path" do
...@@ -346,7 +346,7 @@ class S3Test < Test::Unit::TestCase ...@@ -346,7 +346,7 @@ class S3Test < Test::Unit::TestCase
context "when assigned" do context "when assigned" do
setup 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 = Dummy.new
@dummy.avatar = @file @dummy.avatar = @file
end end
...@@ -437,7 +437,7 @@ class S3Test < Test::Unit::TestCase ...@@ -437,7 +437,7 @@ class S3Test < Test::Unit::TestCase
context "when assigned" do context "when assigned" do
setup 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 = Dummy.new
@dummy.avatar = @file @dummy.avatar = @file
end end
...@@ -472,7 +472,7 @@ class S3Test < Test::Unit::TestCase ...@@ -472,7 +472,7 @@ class S3Test < Test::Unit::TestCase
rails_env('test') rails_env('test')
rebuild_model :storage => :s3, 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.delete_all
@dummy = Dummy.new @dummy = Dummy.new
...@@ -495,7 +495,7 @@ class S3Test < Test::Unit::TestCase ...@@ -495,7 +495,7 @@ class S3Test < Test::Unit::TestCase
rails_env('test') rails_env('test')
rebuild_model :storage => :s3, 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 Dummy.delete_all
...@@ -524,7 +524,7 @@ class S3Test < Test::Unit::TestCase ...@@ -524,7 +524,7 @@ class S3Test < Test::Unit::TestCase
context "when assigned" do context "when assigned" do
setup 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 = Dummy.new
@dummy.avatar = @file @dummy.avatar = @file
end end
...@@ -563,7 +563,7 @@ class S3Test < Test::Unit::TestCase ...@@ -563,7 +563,7 @@ class S3Test < Test::Unit::TestCase
context "when assigned" do context "when assigned" do
setup 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 = Dummy.new
@dummy.avatar = @file @dummy.avatar = @file
end end
...@@ -608,7 +608,7 @@ class S3Test < Test::Unit::TestCase ...@@ -608,7 +608,7 @@ class S3Test < Test::Unit::TestCase
context "when assigned" do context "when assigned" do
setup 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 = Dummy.new
@dummy.avatar = @file @dummy.avatar = @file
end end
...@@ -656,7 +656,7 @@ class S3Test < Test::Unit::TestCase ...@@ -656,7 +656,7 @@ class S3Test < Test::Unit::TestCase
context "when assigned" do context "when assigned" do
setup 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 = Dummy.new
@dummy.stubs(:private_attachment? => true) @dummy.stubs(:private_attachment? => true)
@dummy.avatar = @file @dummy.avatar = @file
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment