Skip to content

Commit

Permalink
DEV: Lint and update spec to not have p1 topic inside
Browse files Browse the repository at this point in the history
  • Loading branch information
Grubba27 committed Apr 26, 2024
1 parent 1a3a77d commit 8584bf6
Showing 1 changed file with 5 additions and 14 deletions.
19 changes: 5 additions & 14 deletions spec/integration/solved_spec.rb
Expand Up @@ -404,30 +404,21 @@
other_topic2 = Fabricate(:topic, title: "Topic that should be there2")
post2 = Fabricate(:post, topic: other_topic2, user: user)

assigner = Assigner.new(p1.topic, user)
result = assigner.assign(user)
expect(result[:success]).to eq(true)

assigner2 = Assigner.new(post.topic, user)
result2 = assigner2.assign(user)
expect(result2[:success]).to eq(true)

assigner3 = Assigner.new(post2.topic, user)
result3 = assigner3.assign(user)
expect(result3[:success]).to eq(true)
Assigner.new(post.topic, user).assign(user)
Assigner.new(post2.topic, user).assign(user)

reminder = PendingAssignsReminder.new
topics = reminder.send(:assigned_topics, user, order: :asc)
expect(topics.to_a.length).to eq(3)
expect(topics.to_a.length).to eq(2)

DiscourseSolved.accept_answer!(post2, Discourse.system_user)
topics = reminder.send(:assigned_topics, user, order: :asc)
expect(topics.to_a.length).to eq(3)
expect(topics.to_a.length).to eq(2)
expect(topics).to include(other_topic2)

SiteSetting.ignore_solved_topics_in_assigned_reminder = true
topics = reminder.send(:assigned_topics, user, order: :asc)
expect(topics.to_a.length).to eq(2)
expect(topics.to_a.length).to eq(1)
expect(topics).not_to include(other_topic2)
expect(topics).to include(other_topic)
end
Expand Down

0 comments on commit 8584bf6

Please sign in to comment.