From 817c2215511606356b23b7539a25334be17a3030 Mon Sep 17 00:00:00 2001 From: Karina Kwiatek Date: Fri, 31 Dec 2021 15:56:15 +0100 Subject: [PATCH] Add basic test for user questions --- spec/controllers/user_controller_spec.rb | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/spec/controllers/user_controller_spec.rb b/spec/controllers/user_controller_spec.rb index 032c5062..050b64bd 100644 --- a/spec/controllers/user_controller_spec.rb +++ b/spec/controllers/user_controller_spec.rb @@ -49,6 +49,20 @@ describe UserController, type: :controller do end end + describe "#questions" do + subject { get :questions, params: { username: user.screen_name } } + + context "user signed in" do + before(:each) { sign_in user } + + it "renders the user/questions template" do + subject + expect(assigns(:user)).to eq(user) + expect(response).to render_template("user/questions") + end + end + end + describe "#edit" do subject { get :edit }