Commit af689b44 by Mike Burns

Fix the fixture issue.

parent 093a14ad
......@@ -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=>"../"
......@@ -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=>"../"
......@@ -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=>"../"
......@@ -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
......@@ -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
......
......@@ -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
......
......@@ -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
......
......@@ -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
......
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