Sha256: 55917b3f3c925480e6f2172041ffa250ce0ac3856375a87ae5904da171b80eb9

Contents?: true

Size: 832 Bytes

Versions: 6

Compression:

Stored size: 832 Bytes

Contents

# frozen_string_literal: true

describe Stenographer::AdminController, type: :controller do
  routes { Stenographer::Engine.routes }

  describe '#index' do
    def index_action(opts = {})
      get :index, params: {}.merge(opts)
    end

    describe 'individual behaviors' do
      let!(:change) { create(:change) }
      let!(:authentication) { create(:authentication) }

      before :each do
        index_action
      end

      it 'assigns @change_count' do
        expect(assigns(:change_count)).to eq(Stenographer::Change.count)
      end

      it 'assigns @authentication_count' do
        expect(assigns(:authentication_count)).to eq(Stenographer::Authentication.count)
      end

      it 'renders the index page' do
        index_action

        expect(response).to render_template(:index)
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
stenographer-rails-0.6.5 spec/controllers/stenographer/admin_controller_spec.rb
stenographer-rails-0.6.4 spec/controllers/stenographer/admin_controller_spec.rb
stenographer-rails-0.6.3 spec/controllers/stenographer/admin_controller_spec.rb
stenographer-rails-0.6.2 spec/controllers/stenographer/admin_controller_spec.rb
stenographer-rails-0.6.1 spec/controllers/stenographer/admin_controller_spec.rb
stenographer-rails-0.6.0 spec/controllers/stenographer/admin_controller_spec.rb