forked from tildeverse/tilde.news
test: ensure stories are hidden in active tab
This commit is contained in:
parent
6a3041a000
commit
37b2ff6bf0
|
@ -13,6 +13,19 @@ describe StoryRepository do
|
|||
|
||||
expect(repo.active).to eq([newer_comment.story, older_comment.story])
|
||||
end
|
||||
|
||||
it "does not show hidden stories" do
|
||||
hidden_story = create(:story)
|
||||
normal_story = create(:story)
|
||||
create(:comment, story: hidden_story)
|
||||
normal_comment = create(:comment, story: normal_story)
|
||||
|
||||
HiddenStory.hide_story_for_user(hidden_story.id, hidden_story.user_id)
|
||||
hidden_story_user = User.find_by(:id => hidden_story.user_id)
|
||||
|
||||
repo = StoryRepository.new(hidden_story_user)
|
||||
expect(repo.active).to eq([normal_comment.story])
|
||||
end
|
||||
end
|
||||
|
||||
describe ".newest_by_user" do
|
||||
|
|
Loading…
Reference in New Issue