correct implementation add tests
This commit is contained in:
parent
3575012a47
commit
48ef609003
|
@ -201,7 +201,7 @@ class TopicQuery
|
|||
|
||||
def latest_results(options={})
|
||||
result = default_results(options)
|
||||
result = remove_muted_topics(result, @user) unless options && options[:state] = "muted".freeze
|
||||
result = remove_muted_topics(result, @user) unless options && options[:state] == "muted".freeze
|
||||
result = remove_muted_categories(result, @user, exclude: options[:category])
|
||||
result
|
||||
end
|
||||
|
|
|
@ -374,6 +374,7 @@ describe TopicQuery do
|
|||
|
||||
it "returns an empty set" do
|
||||
expect(topics).to be_blank
|
||||
expect(topic_query.list_latest.topics).to be_blank
|
||||
end
|
||||
|
||||
context 'un-muted' do
|
||||
|
@ -383,6 +384,7 @@ describe TopicQuery do
|
|||
|
||||
it "returns the topic again" do
|
||||
expect(topics).to eq([new_topic])
|
||||
expect(topic_query.list_latest.topics).not_to be_blank
|
||||
end
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue