test/helper.rb in gowalla-0.5.2 vs test/helper.rb in gowalla-0.5.3
- old
+ new
@@ -9,13 +9,10 @@
$LOAD_PATH.unshift(File.dirname(__FILE__))
require 'gowalla'
FakeWeb.allow_net_connect = false
-class Test::Unit::TestCase
-end
-
def gowalla_test_client
Gowalla::Client.new(:username => 'pengwynn', :password => '0U812', :api_key => 'gowallawallabingbang')
end
def fixture_file(filename)
@@ -27,14 +24,19 @@
def gowalla_url(url)
url =~ /^http/ ? url : "http://api.gowalla.com#{url}"
end
def stub_get(url, filename, options={})
- opts = {:body => fixture_file(filename)}.merge(options)
-
+ opts = {
+ :body => fixture_file(filename),
+ :content_type => 'application/json; charset=utf-8'
+ }.merge(options)
FakeWeb.register_uri(:get, gowalla_url(url), opts)
end
-def stub_post(url, filename)
- FakeWeb.register_uri(:post, gowalla_url(url), :body => fixture_file(filename))
+def stub_post(url, filename, options={})
+ opts = {
+ :body => fixture_file(filename),
+ :content_type => 'application/json; charset=utf-8'
+ }.merge(options)
+ FakeWeb.register_uri(:post, gowalla_url(url), opts)
end
-