Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- require 'spec_helper'
- describe 'getCore tracker check' do
- tracker_url = Airborne.configuration.tracker_url
- app1_url = Airborne.configuration.app1_url
- app2_url = Airborne.configuration.app2_url
- app3_url = Airborne.configuration.app3_url
- tracker_n_url = Airborne.configuration.tracker_n_url
- appid_smooth = Airborne.configuration.appid_smooth
- vinject_smooth = Airborne.configuration.vinject_smooth
- beta = Airborne.configuration.beta
- udid = Airborne.configuration.udid
- context 'CHECK_SMOOTH' do
- before(:all) do
- @tap = Airborne::TapcoreApi.new(tracker_n_url)
- @tap.get_core(tracker_n_url, vinject_smooth, beta, udid, appid_smooth)
- $smooth = json_body[:countries].empty?
- end
- context 'RESPONSE' do
- it 'should be set' do
- expect(response).to_not be(nil)
- end
- end
- context 'HEADERS' do
- it 'should be set' do
- puts "Response headers: #{headers}"
- expect(headers).to_not be(nil)
- end
- it 'correct content-type' do
- expect_header('content-type', 'application/json; charset=utf-8')
- end
- end
- context 'BODY' do
- it 'should be set' do
- puts "Response body size: #{body.size} B"
- expect(body).to_not be(nil)
- end
- end
- context 'STATUS' do
- it 'should be set' do
- expect(status).to_not be(nil)
- end
- it 'correct status' do
- expect_status 200
- end
- end
- context 'JSON' do
- it 'should be set' do
- expect(body).to_not be(nil)
- end
- it 'correct response code value' do
- expect(json_body[:vInject]).to eq(vinject_smooth)
- end
- end
- context 'RESPONSE TIME' do
- it 'correct response time' do
- puts "Response time: #{response_time} sec"
- expect(response_time).to be < 20
- end
- end
- end
- context 'SMOOTH_CORE_CHECK' do
- context 'SMOOTH_CORE_BY_TRACKER' do
- before(:all) do
- if $smooth
- @tap = Airborne::TapcoreApi.new(tracker_url)
- @tap.get_core(tracker_url, vinject_smooth, beta, udid, appid_smooth)
- end
- end
- context 'RESPONSE' do
- it 'should be set' do
- if $smooth
- expect(response).to_not be(nil)
- end
- end
- end
- context 'HEADERS' do
- it 'should be set' do
- puts "Response headers: #{headers}"
- if $smooth
- expect(headers).to_not be(nil)
- end
- end
- it 'correct content-type' do
- if $smooth
- expect_header('content-type', 'text/html')
- end
- end
- end
- context 'BODY' do
- it 'should be set' do
- puts "Response body size: #{body.size} B"
- if $smooth
- expect(body).to_not be(nil)
- end
- end
- end
- context 'STATUS' do
- it 'should be set' do
- if $smooth
- expect(status).to_not be(nil)
- end
- end
- it 'correct status' do
- if $smooth
- expect_status 200
- end
- end
- end
- context 'JSON' do
- it 'should be set' do
- if $smooth
- expect(body).to_not be(nil)
- end
- end
- it 'correct response code value' do
- if $smooth
- expect(json_body[:vInject]).to eq(vinject_smooth)
- end
- end
- end
- context 'RESPONSE TIME' do
- it 'correct response time' do
- puts "Response time: #{response_time} sec"
- expect(response_time).to be < 20
- end
- end
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement