Sha256: 9e83e75c7fa62f612668dbff7c70d8e3bffd613b55e06413541221c4840b5a3d

Contents?: true

Size: 990 Bytes

Versions: 52

Compression:

Stored size: 990 Bytes

Contents

require 'spec_helper'

describe Maestrano::Account::GroupsController, type: :controller do
  routes { Maestrano::Connector::Rails::Engine.routes }

  describe "destroy" do
  	let!(:organization) { create(:organization, uid: 'cld-abc', tenant: 'abc') }
  	let(:params) { {tenant: organization.tenant, id: organization.uid} }
  	subject { delete :destroy, params }

    before {
        controller.class.skip_before_filter :authenticate_maestrano!
    }

  	it 'is successful' do
      subject
  		expect(response).to be_success
  	end

    it 'destroys the organization' do
      expect{ subject }.to change{ Maestrano::Connector::Rails::Organization.count }.by(-1)
    end

    context 'with default tenant' do
      before {
        organization.update(tenant: 'default')
      }
      let(:params) { {id: organization.uid} }

      it 'destroys the organization' do
        expect{ subject }.to change{ Maestrano::Connector::Rails::Organization.count }.by(-1)
      end
    end
  end

end

Version data entries

52 entries across 52 versions & 1 rubygems

Version Path
maestrano-connector-rails-2.0.0.pre.RC2 spec/controllers/groups_controller_spec.rb
maestrano-connector-rails-2.0.0.pre.RC1 spec/controllers/groups_controller_spec.rb
maestrano-connector-rails-1.4.0 spec/controllers/groups_controller_spec.rb
maestrano-connector-rails-1.3.5 spec/controllers/groups_controller_spec.rb
maestrano-connector-rails-1.3.4 spec/controllers/groups_controller_spec.rb
maestrano-connector-rails-1.3.3 spec/controllers/groups_controller_spec.rb
maestrano-connector-rails-1.3.2 spec/controllers/groups_controller_spec.rb
maestrano-connector-rails-1.3.1 spec/controllers/groups_controller_spec.rb
maestrano-connector-rails-1.3.0 spec/controllers/groups_controller_spec.rb
maestrano-connector-rails-1.2.3 spec/controllers/groups_controller_spec.rb
maestrano-connector-rails-1.2.2 spec/controllers/groups_controller_spec.rb
maestrano-connector-rails-1.2.1 spec/controllers/groups_controller_spec.rb
maestrano-connector-rails-1.2.0 spec/controllers/groups_controller_spec.rb
maestrano-connector-rails-1.1.2 spec/controllers/groups_controller_spec.rb
maestrano-connector-rails-1.1.1 spec/controllers/groups_controller_spec.rb
maestrano-connector-rails-1.1.0 spec/controllers/groups_controller_spec.rb
maestrano-connector-rails-1.0.4 spec/controllers/groups_controller_spec.rb
maestrano-connector-rails-1.0.3 spec/controllers/groups_controller_spec.rb
maestrano-connector-rails-1.0.2 spec/controllers/groups_controller_spec.rb
maestrano-connector-rails-1.0.1 spec/controllers/groups_controller_spec.rb