spec/api-client/configuration_spec.rb in api-client-2.1.0 vs spec/api-client/configuration_spec.rb in api-client-2.2.0

- old
+ new

@@ -76,6 +76,25 @@ it 'should merge content_type json with the given hash' do ApiClient.config.header.should == { 'Content-Type' => 'application/xml' } end end + + describe '#basic_auth=' do + before :each do + ApiClient.configure do |config| + config.basic_auth('user', 'pass') + end + end + + after :each do + ApiClient.configure do |config| + config.header = {} + end + end + + it 'should merge basic_auth in header params' do + ApiClient.config.header.should == { 'Content-Type' => 'application/xml', + 'Authorization' => 'Basic dXNlcjpwYXNz' } + end + end end \ No newline at end of file