From 86869dc9935046847fb99e9ac965fc4cb72d4fac Mon Sep 17 00:00:00 2001 From: Andreas Nedbal Date: Mon, 24 Oct 2022 15:32:23 +0200 Subject: [PATCH] Add tests for new instance variables in TimelineController --- spec/controllers/timeline_controller_spec.rb | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/spec/controllers/timeline_controller_spec.rb b/spec/controllers/timeline_controller_spec.rb index 44bc3d26..ab1b275b 100644 --- a/spec/controllers/timeline_controller_spec.rb +++ b/spec/controllers/timeline_controller_spec.rb @@ -92,6 +92,11 @@ describe TimelineController do it { should have_http_status(200) } it_behaves_like "paginates", :followed_user_answers + + it "assigns all lists to an instance variable" do + subject + expect(assigns(:lists)).to eq(user.lists) + end end describe "#list" do @@ -108,6 +113,11 @@ describe TimelineController do subject expect(assigns(:list)).to eq(list) end + + it "excludes the current selected list from the list of lists" do + subject + expect(assigns(:lists)).not_to include(list) + end end end