admin/spec/controllers/gaku/admin/roles_controller_spec.rb in gaku-0.1.1 vs admin/spec/controllers/gaku/admin/roles_controller_spec.rb in gaku-0.2.0

- old
+ new

@@ -6,37 +6,34 @@ let(:invalid_role) { create(:invalid_role) } context 'as student' do before { as :student } - describe 'GET #index' do - before { gaku_get :index } + describe 'XHR #index' do + before { gaku_js_get :index } it { should respond_with 302 } it('redirects') { redirect_to? gaku.root_path } it('sets unauthorized flash') { flash_unauthorized? } end end context 'as admin' do before { as :admin } - context 'html' do - describe 'GET #index' do + context 'js' do + + describe 'XHR #index' do before do role - gaku_get :index + gaku_js_get :index end it { should respond_with 200 } it('assigns @roles') { expect(assigns(:roles)).to include(role) } it('assigns @count') { expect(assigns(:count)).to eq 2 } it('renders :index template') { template? :index } end - - end - - context 'js' do describe 'XHR #new' do before { gaku_js_get :new } it { should respond_with 200 }