Skip to content

Instantly share code, notes, and snippets.

@andreaseriksson
Last active December 17, 2015 11:39
Show Gist options
  • Save andreaseriksson/5604408 to your computer and use it in GitHub Desktop.
Save andreaseriksson/5604408 to your computer and use it in GitHub Desktop.
RSPEC Controller spec #INDEX
describe 'GET#index' do
it "populates an array of messages" do
message = create(:message)
get :index
expect(assigns(:messages)).to match_array [message]
end
it "renders the :index view" do
get :index
response.should render_template :index
expect(response).to render_template :index
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment