Sha256: bc56f86aab9ea48d02cf71786fda63195d490bab1483b931be495cb0b57fd1f8

Contents?: true

Size: 981 Bytes

Versions: 39

Compression:

Stored size: 981 Bytes

Contents

require 'spec_helper'

describe 'billing', :mock_only do
  let!(:consumer_client) { create_client }

  context "with account" do
    let!(:user)       { consumer_client.users.create!(name: Faker::Name.name, email: Faker::Internet.email) }
    let!(:account)    { consumer_client.accounts.create!(owner: user, name_prefix: Faker::Name.first_name) }

    it "has billing state" do
      billing = consumer_client.billing.get(account.id)
      expect(billing.state).to eq "requested"
    end

    it "can update billing state" do
      billing = consumer_client.billing.get(account.id)
      billing.state = "verified"
      billing.save

      billing = consumer_client.billing.get(account.id)
      expect(billing.state).to eq "verified"

      billing = consumer_client.billing.put_state(account.id, "finalized")
      expect(billing.state).to eq "finalized"

      billing = consumer_client.billing.get(account.id)
      expect(billing.state).to eq "finalized"
    end

  end
end

Version data entries

39 entries across 39 versions & 2 rubygems

Version Path
ey-core-3.6.0.autoscaling1 spec/billing_spec.rb
ey-core-3.6.4 spec/billing_spec.rb
ey-core-3.6.3 spec/billing_spec.rb
ey-core-3.6.1 spec/billing_spec.rb
groove-ey-core-3.6.3 spec/billing_spec.rb
groove-ey-core-3.6.2 spec/billing_spec.rb
groove-ey-core-3.6.1 spec/billing_spec.rb
ey-core-3.5.0 spec/billing_spec.rb
ey-core-3.4.4 spec/billing_spec.rb
ey-core-3.4.2 spec/billing_spec.rb
ey-core-3.4.1 spec/billing_spec.rb
ey-core-3.4.0 spec/billing_spec.rb
ey-core-3.3.1 spec/billing_spec.rb
ey-core-3.3.0 spec/billing_spec.rb
ey-core-3.2.6 spec/billing_spec.rb
ey-core-3.2.5 spec/billing_spec.rb
ey-core-3.2.4 spec/billing_spec.rb
ey-core-3.2.3 spec/billing_spec.rb
ey-core-3.2.2 spec/billing_spec.rb
ey-core-3.2.1 spec/billing_spec.rb