test/facebook/test_api.rb in rest-more-2.0.4 vs test/facebook/test_api.rb in rest-more-3.0.0
- old
+ new
@@ -2,26 +2,25 @@
require 'rest-more/test'
describe RC::Facebook do
after do
WebMock.reset!
- RR.verify
+ Muack.verify
end
should 'generate correct url' do
- TestHelper.normalize_url(
RC::Facebook.new(:access_token => 'awesome').
- url('path', :query => 'str')).should.eq \
+ url('path', :query => 'str').should.eq \
'https://graph.facebook.com/path?access_token=awesome&query=str'
end
should 'request to correct server' do
stub_request(:get, 'http://nothing.godfat.org/me').with(
:headers => {'Accept' => 'text/plain',
'Accept-Language' => 'zh-tw',
- 'Accept-Encoding' => 'gzip, deflate', # this is by ruby
- 'User-Agent' => 'Ruby' # this is by ruby
+ 'Accept-Encoding' => /^gzip, ?deflate$/, # this is by ruby
+ 'User-Agent' => 'Ruby' # this is by ruby
}).to_return(:body => '{"data": []}')
RC::Facebook.new(:site => 'http://nothing.godfat.org/',
:lang => 'zh-tw',
:accept => 'text/plain').
@@ -30,11 +29,11 @@
should 'pass custom headers' do
stub_request(:get, 'http://example.com/').with(
:headers => {'Accept' => 'application/json',
'Accept-Language' => 'en-us',
- 'Accept-Encoding' => 'gzip, deflate', # this is by ruby
- 'User-Agent' => 'Ruby', # this is by ruby
+ 'Accept-Encoding' => /^gzip, ?deflate$/, # this is by ruby
+ 'User-Agent' => 'Ruby', # this is by ruby
'X-Forwarded-For' => '127.0.0.1',
}).to_return(:body => '{"data": []}')
RC::Facebook.new.get('http://example.com', {},
{:headers => {'X-Forwarded-For' => '127.0.0.1'}} ).