1
0
Fork 0
mirror of https://github.com/jnunemaker/httparty synced 2023-03-27 23:23:07 -04:00

Tweaked the specs a bit and added spec for basic_auth setting

This commit is contained in:
John Nunemaker 2008-07-28 10:55:35 -04:00
parent 1d48da0313
commit c97b1448ed

View file

@ -12,19 +12,17 @@ end
describe HTTParty do
describe 'base_uri' do
it 'should allow getting' do
Foo.base_uri.should == 'http://api.foo.com/v1'
end
it 'should allow setting' do
Foo.base_uri('api.foobar.com')
Foo.base_uri.should == 'http://api.foobar.com'
end
it 'should set to https if port 443' do
FooWithHttps.base_uri.should == 'https://api.foo.com/v1:443'
end
it 'should be able to get the base_uri' do
Foo.base_uri.should == 'http://api.foo.com/v1'
end
it 'should be able to set the base_uri' do
Foo.base_uri('api.foobar.com')
Foo.base_uri.should == 'http://api.foobar.com'
end
it 'should set scheme to https if port 443' do
FooWithHttps.base_uri.should == 'https://api.foo.com/v1:443'
end
describe 'http' do
@ -38,7 +36,9 @@ describe HTTParty do
end
end
describe 'GET' do
it 'should be able to set basic authentication' do
Foo.basic_auth 'foobar', 'secret'
Foo.instance_variable_get("@auth").should == {:username => 'foobar', :password => 'secret'}
end
end