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:
parent
1d48da0313
commit
c97b1448ed
1 changed files with 15 additions and 15 deletions
|
@ -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
|
Loading…
Add table
Reference in a new issue