From 1fb1071feb482282c7cb5fabfd9e08360c9b0967 Mon Sep 17 00:00:00 2001 From: raluka Date: Wed, 16 Sep 2015 13:29:52 +0200 Subject: [PATCH] moved comment instance into before block --- spec/controllers/admin/comments_controller_spec.rb | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/spec/controllers/admin/comments_controller_spec.rb b/spec/controllers/admin/comments_controller_spec.rb index b3ff0914..ac75b189 100644 --- a/spec/controllers/admin/comments_controller_spec.rb +++ b/spec/controllers/admin/comments_controller_spec.rb @@ -24,10 +24,10 @@ describe Admin::CommentsController, type: :controller do context 'logged in as admin, organizer or cfp' do before :each do sign_in(organizer) + comment end describe 'GET #index' do it 'populates a hash with comments' do - comment get :index expect(assigns(:comments)).to be_a(Hash) # assigns(:comments).first returns an array of first pair key-value from hash. @@ -35,12 +35,10 @@ describe Admin::CommentsController, type: :controller do expect(assigns(:comments).first.first.title).to eq(comment.commentable.conference.title) end it 'has status 200: OK' do - comment get :index expect(response).to have_http_status(:ok) end it 'renders the :index template' do - comment get :index expect(response).to render_template(:index) end