Sha256: 01c4b207843b68b9d53632b87f5573cecda5f0b005ad9a23615195fdaebb1311

Contents?: true

Size: 721 Bytes

Versions: 43

Compression:

Stored size: 721 Bytes

Contents

require 'spec_helper'

describe SharedEntitiesController, type: :controller do
  describe 'index' do
    subject { get :index }

    it { expect(subject).to be_success }

    context 'when user is admin' do
      let(:organization) { create(:organization) }
      let(:idmap) { create(:idmap, organization: organization) }
      before do
        allow_any_instance_of(Maestrano::Connector::Rails::SessionHelper).to receive(:current_organization).and_return(organization)
        allow_any_instance_of(Maestrano::Connector::Rails::SessionHelper).to receive(:is_admin).and_return(true)
      end

      it 'assigns the idmaps' do
        subject
        expect(assigns(:idmaps)).to eq([idmap])
      end
    end
  end
end

Version data entries

43 entries across 43 versions & 1 rubygems

Version Path
maestrano-connector-rails-2.3.6 lib/generators/connector/templates/shared_entities_controller_spec.rb
maestrano-connector-rails-2.3.5 lib/generators/connector/templates/shared_entities_controller_spec.rb
maestrano-connector-rails-2.3.4 lib/generators/connector/templates/shared_entities_controller_spec.rb
maestrano-connector-rails-2.3.3 lib/generators/connector/templates/shared_entities_controller_spec.rb
maestrano-connector-rails-2.3.2 lib/generators/connector/templates/shared_entities_controller_spec.rb
maestrano-connector-rails-2.3.1 lib/generators/connector/templates/shared_entities_controller_spec.rb
maestrano-connector-rails-2.3.0 lib/generators/connector/templates/shared_entities_controller_spec.rb
maestrano-connector-rails-2.2.1 lib/generators/connector/templates/shared_entities_controller_spec.rb
maestrano-connector-rails-2.2.0 lib/generators/connector/templates/shared_entities_controller_spec.rb
maestrano-connector-rails-2.1.3 lib/generators/connector/templates/shared_entities_controller_spec.rb
maestrano-connector-rails-2.1.2 lib/generators/connector/templates/shared_entities_controller_spec.rb
maestrano-connector-rails-2.1.1 lib/generators/connector/templates/shared_entities_controller_spec.rb
maestrano-connector-rails-2.1.0 lib/generators/connector/templates/shared_entities_controller_spec.rb
maestrano-connector-rails-2.0.2.pre.RC12 lib/generators/connector/templates/shared_entities_controller_spec.rb
maestrano-connector-rails-2.0.2.pre.RC11 lib/generators/connector/templates/shared_entities_controller_spec.rb
maestrano-connector-rails-2.0.2.pre.RC10 lib/generators/connector/templates/shared_entities_controller_spec.rb
maestrano-connector-rails-2.0.2.pre.RC8 lib/generators/connector/templates/shared_entities_controller_spec.rb
maestrano-connector-rails-2.0.2.pre.RC9 lib/generators/connector/templates/shared_entities_controller_spec.rb
maestrano-connector-rails-2.0.2.pre.RC7 lib/generators/connector/templates/shared_entities_controller_spec.rb
maestrano-connector-rails-2.0.2.pre.RC6 lib/generators/connector/templates/shared_entities_controller_spec.rb