Add tests for new instance variables in TimelineController

This commit is contained in:
Andreas Nedbal 2022-10-24 15:32:23 +02:00 committed by Andreas Nedbal
parent 14199059b4
commit 86869dc993
1 changed files with 10 additions and 0 deletions

View File

@ -92,6 +92,11 @@ describe TimelineController do
it { should have_http_status(200) } it { should have_http_status(200) }
it_behaves_like "paginates", :followed_user_answers 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 end
describe "#list" do describe "#list" do
@ -108,6 +113,11 @@ describe TimelineController do
subject subject
expect(assigns(:list)).to eq(list) expect(assigns(:list)).to eq(list)
end end
it "excludes the current selected list from the list of lists" do
subject
expect(assigns(:lists)).not_to include(list)
end
end end
end end