Sha256: a2fe4899fc53b1a3e76a4d1287849bfbab1411a69766139f6976b195e361a92e

Contents?: true

Size: 721 Bytes

Versions: 38

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 {
        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)
      }

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

Version data entries

38 entries across 38 versions & 1 rubygems

Version Path
maestrano-connector-rails-1.3.4 lib/generators/connector/templates/shared_entities_controller_spec.rb
maestrano-connector-rails-1.3.3 lib/generators/connector/templates/shared_entities_controller_spec.rb
maestrano-connector-rails-1.3.2 lib/generators/connector/templates/shared_entities_controller_spec.rb
maestrano-connector-rails-1.3.1 lib/generators/connector/templates/shared_entities_controller_spec.rb
maestrano-connector-rails-1.3.0 lib/generators/connector/templates/shared_entities_controller_spec.rb
maestrano-connector-rails-1.2.3 lib/generators/connector/templates/shared_entities_controller_spec.rb
maestrano-connector-rails-1.2.2 lib/generators/connector/templates/shared_entities_controller_spec.rb
maestrano-connector-rails-1.2.1 lib/generators/connector/templates/shared_entities_controller_spec.rb
maestrano-connector-rails-1.2.0 lib/generators/connector/templates/shared_entities_controller_spec.rb
maestrano-connector-rails-1.1.2 lib/generators/connector/templates/shared_entities_controller_spec.rb
maestrano-connector-rails-1.1.1 lib/generators/connector/templates/shared_entities_controller_spec.rb
maestrano-connector-rails-1.1.0 lib/generators/connector/templates/shared_entities_controller_spec.rb
maestrano-connector-rails-1.0.4 lib/generators/connector/templates/shared_entities_controller_spec.rb
maestrano-connector-rails-1.0.3 lib/generators/connector/templates/shared_entities_controller_spec.rb
maestrano-connector-rails-1.0.2 lib/generators/connector/templates/shared_entities_controller_spec.rb
maestrano-connector-rails-1.0.1 lib/generators/connector/templates/shared_entities_controller_spec.rb
maestrano-connector-rails-1.0.0 lib/generators/connector/templates/shared_entities_controller_spec.rb
maestrano-connector-rails-0.4.4 lib/generators/connector/templates/shared_entities_controller_spec.rb
maestrano-connector-rails-0.4.3 lib/generators/connector/templates/shared_entities_controller_spec.rb
maestrano-connector-rails-0.4.2 lib/generators/connector/templates/shared_entities_controller_spec.rb