moved comment instance into before block
This commit is contained in:
parent
f3996a9bff
commit
1fb1071feb
1 changed files with 1 additions and 3 deletions
|
|
@ -24,10 +24,10 @@ describe Admin::CommentsController, type: :controller do
|
||||||
context 'logged in as admin, organizer or cfp' do
|
context 'logged in as admin, organizer or cfp' do
|
||||||
before :each do
|
before :each do
|
||||||
sign_in(organizer)
|
sign_in(organizer)
|
||||||
|
comment
|
||||||
end
|
end
|
||||||
describe 'GET #index' do
|
describe 'GET #index' do
|
||||||
it 'populates a hash with comments' do
|
it 'populates a hash with comments' do
|
||||||
comment
|
|
||||||
get :index
|
get :index
|
||||||
expect(assigns(:comments)).to be_a(Hash)
|
expect(assigns(:comments)).to be_a(Hash)
|
||||||
# assigns(:comments).first returns an array of first pair key-value from 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)
|
expect(assigns(:comments).first.first.title).to eq(comment.commentable.conference.title)
|
||||||
end
|
end
|
||||||
it 'has status 200: OK' do
|
it 'has status 200: OK' do
|
||||||
comment
|
|
||||||
get :index
|
get :index
|
||||||
expect(response).to have_http_status(:ok)
|
expect(response).to have_http_status(:ok)
|
||||||
end
|
end
|
||||||
it 'renders the :index template' do
|
it 'renders the :index template' do
|
||||||
comment
|
|
||||||
get :index
|
get :index
|
||||||
expect(response).to render_template(:index)
|
expect(response).to render_template(:index)
|
||||||
end
|
end
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue