Sha256: eed1c2edc3f448fd477a0275a2b05f623ffec456774066f7b87f7796e304b0a5

Contents?: true

Size: 696 Bytes

Versions: 2

Compression:

Stored size: 696 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(ApplicationHelper).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

2 entries across 2 versions & 1 rubygems

Version Path
maestrano-connector-rails-0.2.18 lib/generators/connector/templates/shared_entities_controller_spec.rb
maestrano-connector-rails-0.2.17 lib/generators/connector/templates/shared_entities_controller_spec.rb