Sha256: fd2df1e2e7b3f75055a2ec9db209b7a302c75334a8e81697b25b6c8906863fc7

Contents?: true

Size: 1.23 KB

Versions: 8

Compression:

Stored size: 1.23 KB

Contents

describe ::PPC::API::Baidu::Group do
  auth = $baidu_auth

  test_plan_id = ::PPC::API::Baidu::Plan.ids(auth)[:result][0]
  test_group_id = []

  it 'can get all group' do 
    response = ::PPC::API::Baidu::Group::ids( auth )
    is_success( response ) 
  end

  it 'can add group' do 
    group = { name: 'test_group', plan_id:test_plan_id, price:500 }
    response = ::PPC::API::Baidu::Group::add( auth, group )
    is_success( response )
    test_group_id << response[:result][0][:id]
  end
  
  it 'can update group' do 
    group = { id: test_group_id[0], price:600 }
    response = ::PPC::API::Baidu::Group::update( auth, group )
    is_success( response )
  end

  it 'can search group by group id' do
    response = ::PPC::API::Baidu::Group::get( auth, test_group_id )
    is_success( response )
  end
  
  it 'can search group id by plan id' do
    response = ::PPC::API::Baidu::Group::search_id_by_plan_id( auth, test_plan_id )
    is_success( response )
  end

  it 'search by plan id' do 
    response = ::PPC::API::Baidu::Group::search_by_plan_id( auth, test_plan_id )
    is_success( response )
  end  

  it 'can delete group' do 
    response = ::PPC::API::Baidu::Group::delete( auth, test_group_id )
    is_success( response )
  end
  
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
ppc-2.0.5 spec/baidu/api_baidu_group_spec.rb
ppc-2.0.4 spec/baidu/api_baidu_group_spec.rb
ppc-2.0.3 spec/baidu/api_baidu_group_spec.rb
ppc-2.0.2 spec/baidu/api_baidu_group_spec.rb
ppc-2.0.1 spec/baidu/api_baidu_group_spec.rb
ppc-2.0.0 spec/baidu/api_baidu_group_spec.rb
ppc-1.3.2 spec/baidu/api_baidu_group_spec.rb
ppc-0.3.0 spec/baidu/api_baidu_group_spec.rb