Replaces it "should xx" by it "xxs" in comment_spec

This commit is contained in:
kikito
2015-09-18 10:25:08 +02:00
parent fcdfe2341e
commit 1e8605fa28

View File

@@ -4,7 +4,7 @@ describe Comment do
let(:comment) { build(:comment) } let(:comment) { build(:comment) }
it "should be valid" do it "is valid" do
expect(comment).to be_valid expect(comment).to be_valid
end end
@@ -18,7 +18,7 @@ describe Comment do
end end
describe "#as_administrator?" do describe "#as_administrator?" do
it "should be true if comment has administrator_id, false otherway" do it "is true if comment has administrator_id, false otherway" do
expect(comment).not_to be_as_administrator expect(comment).not_to be_as_administrator
comment.administrator_id = 33 comment.administrator_id = 33
@@ -28,7 +28,7 @@ describe Comment do
end end
describe "#as_moderator?" do describe "#as_moderator?" do
it "should be true if comment has moderator_id, false otherway" do it "is true if comment has moderator_id, false otherway" do
expect(comment).not_to be_as_moderator expect(comment).not_to be_as_moderator
comment.moderator_id = 21 comment.moderator_id = 21
@@ -40,27 +40,27 @@ describe Comment do
describe "cache" do describe "cache" do
let(:comment) { create(:comment) } let(:comment) { create(:comment) }
it "should expire cache when it has a new vote" do it "expires cache when it has a new vote" do
expect { create(:vote, votable: comment) } expect { create(:vote, votable: comment) }
.to change { comment.updated_at } .to change { comment.updated_at }
end end
it "should expire cache when hidden" do it "expires cache when hidden" do
expect { comment.hide } expect { comment.hide }
.to change { comment.updated_at } .to change { comment.updated_at }
end end
it "should expire cache when the author is hidden" do it "expires cache when the author is hidden" do
expect { comment.user.hide } expect { comment.user.hide }
.to change { [comment.reload.updated_at, comment.author.updated_at] } .to change { [comment.reload.updated_at, comment.author.updated_at] }
end end
it "should expire cache when the author changes" do it "expires cache when the author changes" do
expect { comment.user.update(username: "Isabel") } expect { comment.user.update(username: "Isabel") }
.to change { [comment.reload.updated_at, comment.author.updated_at] } .to change { [comment.reload.updated_at, comment.author.updated_at] }
end end
it "should expire cache when the author's organization get verified" do it "expires cache when the author's organization get verified" do
create(:organization, user: comment.user) create(:organization, user: comment.user)
expect { comment.user.organization.verify } expect { comment.user.organization.verify }
.to change { [comment.reload.updated_at, comment.author.updated_at] } .to change { [comment.reload.updated_at, comment.author.updated_at] }