Sha256: 1a96ccff2abffff97929e01cf8e8022445218f154834ca1006d632f06718a658

Contents?: true

Size: 1.44 KB

Versions: 20

Compression:

Stored size: 1.44 KB

Contents

describe DeployGate::Xcode::MemberCenters::App do
  let(:email) { 'test@example.com' }
  let(:registered_uuid) { 'com.example.test.registered' }
  let(:non_registered_uuid) { 'com.example.test.non.registered' }
  let(:app) { DeployGate::Xcode::MemberCenters::App.new('com.example.test.new.app') }

  before do
    allow_any_instance_of(Spaceship::PortalClient).to receive(:login) {}
    allow_any_instance_of(Spaceship::PortalClient).to receive(:teams) {['team_name', 'team_id']}
    allow_any_instance_of(Spaceship::Launcher).to receive(:select_team) {}
    allow_any_instance_of(Spaceship::PortalClient).to receive(:apps) {[
        {"identifier" => registered_uuid}
    ]}
    allow_any_instance_of(DeployGate::Xcode::MemberCenter).to receive(:input_email).and_return(email)
  end


  context "#created?" do

    it "app created" do
      app = DeployGate::Xcode::MemberCenters::App.new(registered_uuid)

      expect(app.created?).to be_truthy
    end

    it "no app created" do
      app = DeployGate::Xcode::MemberCenters::App.new(non_registered_uuid)

      expect(app.created?).to be_falsey
    end
  end

  context "#create!" do
    it "must call Spaceshio.app.create!" do
      call_create = false
      allow(Spaceship::Portal::App).to receive(:create!) { call_create = true }

      app.create!
      expect(call_create).to be_truthy
    end
  end

  context "#name" do
    it "get name" do
      expect(app.name).to eq 'com example test new app'
    end
  end
end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
deploygate-0.7.0 spec/deploygate/xcode/member_centers/app_spec.rb
deploygate-0.6.8 spec/deploygate/xcode/member_centers/app_spec.rb
deploygate-0.6.7 spec/deploygate/xcode/member_centers/app_spec.rb
deploygate-0.6.6 spec/deploygate/xcode/member_centers/app_spec.rb
deploygate-0.6.5 spec/deploygate/xcode/member_centers/app_spec.rb
deploygate-0.6.4 spec/deploygate/xcode/member_centers/app_spec.rb
deploygate-0.6.3 spec/deploygate/xcode/member_centers/app_spec.rb
deploygate-0.6.2 spec/deploygate/xcode/member_centers/app_spec.rb
deploygate-0.6.1 spec/deploygate/xcode/member_centers/app_spec.rb
deploygate-0.6.0 spec/deploygate/xcode/member_centers/app_spec.rb
deploygate-0.5.6 spec/deploygate/xcode/member_centers/app_spec.rb
deploygate-0.5.5 spec/deploygate/xcode/member_centers/app_spec.rb
deploygate-0.5.4 spec/deploygate/xcode/member_centers/app_spec.rb
deploygate-0.5.3 spec/deploygate/xcode/member_centers/app_spec.rb
deploygate-0.5.2 spec/deploygate/xcode/member_centers/app_spec.rb
deploygate-0.5.1 spec/deploygate/xcode/member_centers/app_spec.rb
deploygate-0.5.0 spec/deploygate/xcode/member_centers/app_spec.rb
deploygate-0.4.1 spec/deploygate/xcode/member_centers/app_spec.rb
deploygate-0.4.0 spec/deploygate/xcode/member_centers/app_spec.rb
deploygate-0.3.3 spec/deploygate/xcode/member_centers/app_spec.rb