Sha256: ca0e3516d6409289800379ad01ebb8df987bd985f4535d133fd3ccc1fdabd128

Contents?: true

Size: 1.13 KB

Versions: 7

Compression:

Stored size: 1.13 KB

Contents

describe ::PPC::API::Sogou::Plan do
  auth = $sogou_auth

  test_plan_id = []

  it "can get all plans" do
    response = ::PPC::API::Sogou::Plan::all( auth )
    is_success( response )
    expect(response[:result]).not_to be_nil
  end

  it "can get all plan id" do 
    response = ::PPC::API::Sogou::Plan::ids( auth )
    is_success( response )
    expect(response[:result]).not_to be_nil
  end 

  it "can add plan" do
    test_plan = { name: "test_elong", negative: ["test"] }
    response = ::PPC::API::Sogou::Plan::add( auth, test_plan )
    is_success( response )
    test_plan_id << response[:result][0][:id]
  end

  it "can get plan by id" do
    response = ::PPC::API::Sogou::Plan::get( auth, test_plan_id )
    is_success( response )
    expect(response[:result]).not_to be_nil
  end

  it 'can update plan' do
    update = { id: test_plan_id[0], name:"test_plan_update"}
    response = ::PPC::API::Sogou::Plan::update( auth, update )
    is_success( response )
    expect(response[:result]).not_to be_nil
  end

  it "can delete plan" do
    response = ::PPC::API::Sogou::Plan::delete( auth, test_plan_id )
    is_success( response )
  end

end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
ppc-2.0.5 spec/sogou/api_sogou_plan_spec.rb
ppc-2.0.4 spec/sogou/api_sogou_plan_spec.rb
ppc-2.0.3 spec/sogou/api_sogou_plan_spec.rb
ppc-2.0.2 spec/sogou/api_sogou_plan_spec.rb
ppc-2.0.1 spec/sogou/api_sogou_plan_spec.rb
ppc-2.0.0 spec/sogou/api_sogou_plan_spec.rb
ppc-1.3.2 spec/sogou/api_sogou_plan_spec.rb