Sha256: cdfcba0bf1570d1812c50365ba3737fa2d9554ac10af8d14fe396e1eec2efa83

Contents?: true

Size: 774 Bytes

Versions: 37

Compression:

Stored size: 774 Bytes

Contents

require 'spec_helper'

describe "ey whoami" do
  given "integration"

  context "logged in" do
    before { login_scenario 'empty' }
    it "outputs the currently logged in user" do
      ey %w[whoami]
      @out.should include("User Name (#{scenario_email})")
    end
  end

  context "not logged in" do
    it "prompts for authentication before outputting the logged in user" do
      api_scenario 'empty'

      ey(%w[whoami], :hide_err => true) do |input|
        input.puts(scenario_email)
        input.puts(scenario_password)
      end

      @out.should include("We need to fetch your API token; please log in.")
      @out.should include("Email:")
      @out.should include("Password:")

      @out.should include("User Name (#{scenario_email})")
    end
  end
end

Version data entries

37 entries across 37 versions & 1 rubygems

Version Path
engineyard-3.1.2 spec/ey/whoami_spec.rb
engineyard-3.1.1 spec/ey/whoami_spec.rb
engineyard-3.1.0 spec/ey/whoami_spec.rb
engineyard-3.0.1 spec/ey/whoami_spec.rb
engineyard-3.0.0 spec/ey/whoami_spec.rb
engineyard-2.3.3 spec/ey/whoami_spec.rb
engineyard-2.3.2 spec/ey/whoami_spec.rb
engineyard-2.3.1 spec/ey/whoami_spec.rb
engineyard-2.3.0 spec/ey/whoami_spec.rb
engineyard-2.2.1 spec/ey/whoami_spec.rb
engineyard-2.2.0 spec/ey/whoami_spec.rb
engineyard-2.2.0.rc1 spec/ey/whoami_spec.rb
engineyard-2.1.3 spec/ey/whoami_spec.rb
engineyard-2.1.2 spec/ey/whoami_spec.rb
engineyard-2.1.1 spec/ey/whoami_spec.rb
engineyard-2.1.0 spec/ey/whoami_spec.rb
engineyard-2.1.0.rc1 spec/ey/whoami_spec.rb
engineyard-2.0.13 spec/ey/whoami_spec.rb
engineyard-2.0.12 spec/ey/whoami_spec.rb
engineyard-2.0.11 spec/ey/whoami_spec.rb