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-0.4.1 lib/generators/connector/templates/shared_entities_controller_spec.rb
maestrano-connector-rails-0.4.0 lib/generators/connector/templates/shared_entities_controller_spec.rb
maestrano-connector-rails-0.3.13 lib/generators/connector/templates/shared_entities_controller_spec.rb
maestrano-connector-rails-0.3.12 lib/generators/connector/templates/shared_entities_controller_spec.rb
maestrano-connector-rails-0.3.11 lib/generators/connector/templates/shared_entities_controller_spec.rb
maestrano-connector-rails-0.3.10 lib/generators/connector/templates/shared_entities_controller_spec.rb
maestrano-connector-rails-0.3.9 lib/generators/connector/templates/shared_entities_controller_spec.rb
maestrano-connector-rails-0.3.8 lib/generators/connector/templates/shared_entities_controller_spec.rb
maestrano-connector-rails-0.3.7 lib/generators/connector/templates/shared_entities_controller_spec.rb
maestrano-connector-rails-0.3.6 lib/generators/connector/templates/shared_entities_controller_spec.rb
maestrano-connector-rails-0.3.5 lib/generators/connector/templates/shared_entities_controller_spec.rb
maestrano-connector-rails-0.3.4 lib/generators/connector/templates/shared_entities_controller_spec.rb
maestrano-connector-rails-0.3.3 lib/generators/connector/templates/shared_entities_controller_spec.rb
maestrano-connector-rails-0.3.2 lib/generators/connector/templates/shared_entities_controller_spec.rb
maestrano-connector-rails-0.3.1 lib/generators/connector/templates/shared_entities_controller_spec.rb
maestrano-connector-rails-0.3.0 lib/generators/connector/templates/shared_entities_controller_spec.rb
maestrano-connector-rails-0.2.20 lib/generators/connector/templates/shared_entities_controller_spec.rb
maestrano-connector-rails-0.2.19 lib/generators/connector/templates/shared_entities_controller_spec.rb