Updated account spec to generate doc #2928

This commit is contained in:
Priit Tark 2015-09-09 12:23:53 +03:00
parent 48aa2b9a6a
commit 8b3c240262

View file

@ -3,7 +3,8 @@ require 'rails_helper'
describe Repp::AccountV1 do
it 'should fail without whitelisted IP' do
ENV['webclient_ips'] = '192.188.1.1'
@registrar1 = Fabricate(:registrar, white_ips: [Fabricate(:white_ip_registrar)])
Setting.api_ip_whitelist_enabled = true
@registrar1 = Fabricate(:registrar, white_ips: [Fabricate(:white_ip_registrar, ipv4: '99.99.99.99')])
@api_user = Fabricate(:api_user, registrar: @registrar1)
get_with_auth '/repp/v1/accounts/balance', {}, @api_user
@ -12,6 +13,7 @@ describe Repp::AccountV1 do
body['error'].should == 'IP is not whitelisted'
ENV['webclient_ips'] = '127.0.0.1'
Setting.api_ip_whitelist_enabled = false
end
context 'with valid registrar' do