correct implementation add tests

This commit is contained in:
Sam 2015-11-02 15:05:08 +11:00
parent 3575012a47
commit 48ef609003
2 changed files with 3 additions and 1 deletions

View file

@ -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

View file

@ -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