require_relative "../spec_helper" # require the special spec_helper in localhost/

# TOOD: find a less quick-and-dirty way to do this
def test_integration_with_xlsx
  # Stripping indent & newlines from heredoc
  <<-CMD.gsub(/^[\s\t]*/, "").gsub(/[\s\t]*\n/, " ").strip
    curl
      -i
      -H 'WORKSTATION-TRUSTED: true'
      -F file=@/tmp/foo.xlsx
      http://qa-ows-bulkperformance.elasticbeanstalk.com/upload/vendor/4
  CMD
end

def test_hello
  "curl -I http://qa-ows-bulkperformance.elasticbeanstalk.com/hello"
end

xdescribe command(test_hello) do
  its(:stdout) { should contain("HTTP/1.1 200 OK") }
end

# xdescribe marks the test pending
xdescribe command(test_integration_with_xlsx) do
  let(:pre_command) { "echo '/tmp/foo.xlsx' > /tmp/foo.xlsx" }
  its(:stdout) { should contain("HTTP/1.1 200 OK") }
end
