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.2.0 spec/billing_spec.rb
ey-core-3.1.11 spec/billing_spec.rb
ey-core-3.1.10 spec/billing_spec.rb
ey-core-3.1.9 spec/billing_spec.rb
ey-core-3.1.8 spec/billing_spec.rb
ey-core-3.1.7 spec/billing_spec.rb
ey-core-3.1.6 spec/billing_spec.rb
ey-core-3.1.5 spec/billing_spec.rb
ey-core-3.1.4 spec/billing_spec.rb
ey-core-3.1.3 spec/billing_spec.rb
ey-core-3.1.2 spec/billing_spec.rb
ey-core-3.1.1 spec/billing_spec.rb
ey-core-3.1.0 spec/billing_spec.rb
ey-core-3.0.5 spec/billing_spec.rb
ey-core-3.0.4 spec/billing_spec.rb
ey-core-3.0.3 spec/billing_spec.rb
ey-core-3.0.2 spec/billing_spec.rb
ey-core-3.0.1 spec/billing_spec.rb
ey-core-3.0.0 spec/billing_spec.rb