Skip to content

Instantly share code, notes, and snippets.

@Tocacar
Last active July 9, 2019 07:46
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Tocacar/bdf0744d33616bd5be8b3eaffa5f9aa9 to your computer and use it in GitHub Desktop.
Save Tocacar/bdf0744d33616bd5be8b3eaffa5f9aa9 to your computer and use it in GitHub Desktop.
RSpec.describe UsersController, type: :controller do
describe "GET index" do
it “returns a successful response” do
get :index
expect(response).to be_successful
end
it "assigns @users" do
user = User.create(name: “Test user”)
get :index
expect(assigns(:users)).to eq([user])
end
it "renders the index template" do
get :index
expect(response).to render_template("index")
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment