Sha256: 4b41e4293367ea5f56a40a6da0939e62b07c59e1f4b90de2dcb788eb93592642
Contents?: true
Size: 922 Bytes
Versions: 12
Compression:
Stored size: 922 Bytes
Contents
require 'spec_helper' describe Krikri::ProvidersController, :type => :controller do routes { Krikri::Engine.routes } describe 'GET #show' do login_user it 'sets provider variable' do expect { get :show, id: 'moomin' } .to change { assigns[:current_provider] } .to an_instance_of(Krikri::Provider) end it 'renders the :show view' do get :show, id: 'moomin' expect(response).to render_template('krikri/providers/show') end end describe 'GET #index' do login_user it 'renders the :show view' do get :index expect(response).to render_template('krikri/providers/index') end it 'sets providers variable' do providers = [instance_double(Krikri::Provider)] allow(Krikri::Provider).to receive(:all).and_return(providers) expect { get :index }.to change { assigns[:providers] }.to(providers) end end end
Version data entries
12 entries across 12 versions & 1 rubygems