diff options
author | ThibG <thib@sitedethib.com> | 2018-12-06 17:40:43 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-12-06 17:40:43 +0100 |
commit | e3682c9c1750e5e7e5d2f817e29f6760a18400ca (patch) | |
tree | 1fb5c57e634a16136e764178e2e1ca1d0e009a25 /spec/controllers | |
parent | 4167ed375bd9402e91a998fad8f173fa76b2eec3 (diff) | |
parent | 24822eca73ac2bc37870bd27cae8ee6b17785759 (diff) |
Merge pull request #848 from ThibG/glitch-soc/merge-upstream
Merge upstream changes
Diffstat (limited to 'spec/controllers')
-rw-r--r-- | spec/controllers/statuses_controller_spec.rb | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/spec/controllers/statuses_controller_spec.rb b/spec/controllers/statuses_controller_spec.rb index b4f3c5a08..1bb6636c6 100644 --- a/spec/controllers/statuses_controller_spec.rb +++ b/spec/controllers/statuses_controller_spec.rb @@ -115,14 +115,18 @@ describe StatusesController do end it 'assigns @descendant_threads for threads with :next_status key if they are hitting the depth limit' do - stub_const 'StatusesController::DESCENDANTS_DEPTH_LIMIT', 1 + stub_const 'StatusesController::DESCENDANTS_DEPTH_LIMIT', 2 status = Fabricate(:status) - child = Fabricate(:status, in_reply_to_id: status.id) + child0 = Fabricate(:status, in_reply_to_id: status.id) + child1 = Fabricate(:status, in_reply_to_id: child0.id) + child2 = Fabricate(:status, in_reply_to_id: child0.id) get :show, params: { account_username: status.account.username, id: status.id } - expect(assigns(:descendant_threads)[0][:statuses].pluck(:id)).not_to include child.id - expect(assigns(:descendant_threads)[0][:next_status].id).to eq child.id + expect(assigns(:descendant_threads)[0][:statuses].pluck(:id)).not_to include child1.id + expect(assigns(:descendant_threads)[1][:statuses].pluck(:id)).not_to include child2.id + expect(assigns(:descendant_threads)[0][:next_status].id).to eq child1.id + expect(assigns(:descendant_threads)[1][:next_status].id).to eq child2.id end it 'returns a success' do |