Sha256: e125b25b680e85ce953785768483d6c1733e91d2a9ceeabe0316690bc6373333

Contents?: true

Size: 1.45 KB

Versions: 39

Compression:

Stored size: 1.45 KB

Contents

require 'spec_helper'

describe 'application_archives' do
  let(:client)       { create_client }
  let!(:account)     { create_account(client: client) }
  let!(:provider)    { create_provider(account: account) }
  let!(:application) { account.applications.create!(name: "hello_servlet", type: "java") }

  it "should create an application archive" do
    archive = application.archives.create!(filename: "helloservlet.war")

    # FIXME: archive.application.should == application
    expect(archive.filename).to eq("helloservlet.war")
    expect(archive.upload_successful).to eq(false)
    expect(archive.upload_url).to be
  end

  context "with an archive", :mock_only do # needs uploaded archives to pass
    let!(:archive) { application.archives.create!(filename: "helloservlet.war") }

    it "should upload, mark that it was successful, and download" do
      archive.upload(body: "enterprise")

      expect(archive.upload_successful).to eq(true)

      expect(archive.download.body).to eq("enterprise")
    end

    context "with multiple archives" do
      let!(:another_application) { account.applications.create!(name: "hello_bean", type: "java") }
      let!(:another_archive)     { another_application.archives.create!(filename: "helloservlet.war") }

      it "should list based on application" do
        expect(application.archives.all).to match_array([archive])
        expect(another_application.archives.all).to match_array([another_archive])
      end
    end
  end
end

Version data entries

39 entries across 39 versions & 2 rubygems

Version Path
ey-core-3.2.0 spec/application_archives_spec.rb
ey-core-3.1.11 spec/application_archives_spec.rb
ey-core-3.1.10 spec/application_archives_spec.rb
ey-core-3.1.9 spec/application_archives_spec.rb
ey-core-3.1.8 spec/application_archives_spec.rb
ey-core-3.1.7 spec/application_archives_spec.rb
ey-core-3.1.6 spec/application_archives_spec.rb
ey-core-3.1.5 spec/application_archives_spec.rb
ey-core-3.1.4 spec/application_archives_spec.rb
ey-core-3.1.3 spec/application_archives_spec.rb
ey-core-3.1.2 spec/application_archives_spec.rb
ey-core-3.1.1 spec/application_archives_spec.rb
ey-core-3.1.0 spec/application_archives_spec.rb
ey-core-3.0.5 spec/application_archives_spec.rb
ey-core-3.0.4 spec/application_archives_spec.rb
ey-core-3.0.3 spec/application_archives_spec.rb
ey-core-3.0.2 spec/application_archives_spec.rb
ey-core-3.0.1 spec/application_archives_spec.rb
ey-core-3.0.0 spec/application_archives_spec.rb