Sha256: 6836766924bd7ef3dc234b8fe14d1a199fb745ddd04c8e90e6c4c45dfa219178

Contents?: true

Size: 689 Bytes

Versions: 3

Compression:

Stored size: 689 Bytes

Contents

RSpec.describe Dashing::DashboardsController do

  before do
    @routes = Dashing::Engine.routes
  end

  describe 'GET "index"' do

    def action
      get :index
    end

    it 'responds success' do
      action
      expect(response).to be_success
    end

  end

  describe 'GET "show"' do

    def action(params = {})
      get :show, params
    end

    context 'when template exists' do

      it 'responds success' do
        action(name: 'foo')
        expect(response).to be_success
      end

    end

    context 'when template does not exist' do

      it { expect { action }.to raise_error }
      it { expect { action(name: 'bar') }.to raise_error }

    end

  end

end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
dashing-rails-2.6.2 spec/controllers/dashing/dashboards_controller_spec.rb
dashing-rails-2.6.1 spec/controllers/dashing/dashboards_controller_spec.rb
dashing-rails-2.6.0 spec/controllers/dashing/dashboards_controller_spec.rb