Use hidden trait in specs

We were using it in most places, but there were a few where we still
used `hidden_at: Time.current`.
This commit is contained in:
Javi Martín
2019-09-23 22:17:12 +02:00
parent f27beb1e47
commit 2b2c528098
5 changed files with 16 additions and 12 deletions

View File

@@ -305,7 +305,7 @@ describe "Consul Schema" do
it "does not include hidden comments" do
visible_comment = create(:comment)
hidden_comment = create(:comment, hidden_at: Time.current)
hidden_comment = create(:comment, :hidden)
response = execute("{ comments { edges { node { body } } } }")
received_comments = extract_fields(response, "comments", "body")
@@ -315,7 +315,7 @@ describe "Consul Schema" do
it "does not include comments from hidden proposals" do
visible_proposal = create(:proposal)
hidden_proposal = create(:proposal, hidden_at: Time.current)
hidden_proposal = create(:proposal, :hidden)
visible_proposal_comment = create(:comment, commentable: visible_proposal)
hidden_proposal_comment = create(:comment, commentable: hidden_proposal)
@@ -328,7 +328,7 @@ describe "Consul Schema" do
it "does not include comments from hidden debates" do
visible_debate = create(:debate)
hidden_debate = create(:debate, hidden_at: Time.current)
hidden_debate = create(:debate, :hidden)
visible_debate_comment = create(:comment, commentable: visible_debate)
hidden_debate_comment = create(:comment, commentable: hidden_debate)
@@ -341,7 +341,7 @@ describe "Consul Schema" do
it "does not include comments from hidden polls" do
visible_poll = create(:poll)
hidden_poll = create(:poll, hidden_at: Time.current)
hidden_poll = create(:poll, :hidden)
visible_poll_comment = create(:comment, commentable: visible_poll)
hidden_poll_comment = create(:comment, commentable: hidden_poll)
@@ -575,7 +575,7 @@ describe "Consul Schema" do
it "does not include votes of hidden proposals" do
visible_proposal = create(:proposal)
hidden_proposal = create(:proposal, hidden_at: Time.current)
hidden_proposal = create(:proposal, :hidden)
visible_proposal_vote = create(:vote, votable: visible_proposal)
hidden_proposal_vote = create(:vote, votable: hidden_proposal)
@@ -588,7 +588,7 @@ describe "Consul Schema" do
it "does not include votes of hidden comments" do
visible_comment = create(:comment)
hidden_comment = create(:comment, hidden_at: Time.current)
hidden_comment = create(:comment, :hidden)
visible_comment_vote = create(:vote, votable: visible_comment)
hidden_comment_vote = create(:vote, votable: hidden_comment)