test/test_helper.rb in jackie-0.0.2 vs test/test_helper.rb in jackie-0.0.3

- old
+ new

@@ -10,10 +10,24 @@ require "minitest/autorun" Jackie.api_key = "MyKickfolioApiKey" class MiniTest::Unit::TestCase + def with_fake_s3 + Jackie.configure_s3({ + :access_key_id => "123", + :secret_access_key => "abc", + :server => "localhost", + :port => "10453" + }, {:bucket => "nuvado-test"}) + + yield + ensure + AWS::S3::Base.disconnect! + Jackie::Version.uploader = nil + end + def self.mock_requests! # FIXME move to fixture module @app = { "id" => "1", "user_id"=>"1", "name"=>"firebaseco", @@ -43,8 +57,9 @@ @headers = {"Accept"=>"application/vnd.kickfolio.v1", "Authorization"=>"Basic TXlLaWNrZm9saW9BcGlLZXk="} ActiveResource::HttpMock.respond_to do |mock| mock.get "/api/apps/1.json", @headers, @app mock.get "/api/versions.json?app_id=1", @headers, [@version].to_json mock.get "/api/versions/1.json", @headers, @version.to_json + mock.post "/api/versions.json", @headers end end end