Last active
July 9, 2019 07:46
-
-
Save Tocacar/bdf0744d33616bd5be8b3eaffa5f9aa9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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