Before creating the test, if you use TDD (Test Driven Development), you have to know what your implementation, in case the action index of your controller, will return.
In your case, it returns an array with all the articles, so you can create an assigns that will simulate your instance variable:
To create articles in the development environment, use a before each, preferably with some type of Factory Girl:
Rspec.describe ArticlesController do
before :each do
@article1 = Article.create(name: 'foo')
@article2 = Article.create(name: 'bar')
end
describe '#index' do
it 'return an array of articles' do
assigns(:articles).should eq([@article1, @article2]).
end
end
end