Merge pull request #2206 from riking/posted
Fix the 'posted' view so that it actually does something
This commit is contained in:
commit
706fd3c59a
|
@ -81,7 +81,7 @@ class TopicQuery
|
|||
end
|
||||
|
||||
def list_posted
|
||||
create_list(:posted) {|l| l.where('tu.user_id IS NOT NULL') }
|
||||
create_list(:posted) {|l| l.where('tu.posted') }
|
||||
end
|
||||
|
||||
def list_top_for(period)
|
||||
|
|
|
@ -352,7 +352,40 @@ describe TopicQuery do
|
|||
it "includes the posted topic" do
|
||||
topics.include?(other_users_topic).should be_true
|
||||
end
|
||||
end
|
||||
|
||||
context "topic you haven't posted in" do
|
||||
let(:other_users_topic) { create_post(user: creator).topic }
|
||||
|
||||
it "does not include the topic" do
|
||||
topics.should be_blank
|
||||
end
|
||||
|
||||
context "but interacted with" do
|
||||
it "is not included if starred" do
|
||||
other_users_topic.toggle_star(user, true)
|
||||
|
||||
topics.should be_blank
|
||||
end
|
||||
|
||||
it "is not included if read" do
|
||||
TopicUser.update_last_read(user, other_users_topic.id, 0, 0)
|
||||
|
||||
topics.should be_blank
|
||||
end
|
||||
|
||||
it "is not included if muted" do
|
||||
other_users_topic.notify_muted!(user)
|
||||
|
||||
topics.should be_blank
|
||||
end
|
||||
|
||||
it "is not included if tracking" do
|
||||
other_users_topic.notify_tracking!(user)
|
||||
|
||||
topics.should be_blank
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
|
Loading…
Reference in New Issue