mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-23 23:58:31 -05:00
Correct unit tests
This commit is contained in:
parent
7312ee699b
commit
ddc3c992b7
2 changed files with 2 additions and 3 deletions
|
@ -417,6 +417,7 @@ Discourse.PostStream = Em.Object.extend({
|
|||
}
|
||||
this.get('stream').removeObject(-1);
|
||||
this.get('postIdentityMap').set(-1, null);
|
||||
this.get('postIdentityMap').set(post.get('id'), post);
|
||||
|
||||
this.get('stream').addObject(post.get('id'));
|
||||
this.set('stagingPost', false);
|
||||
|
|
|
@ -306,10 +306,9 @@ test("staging and undoing a new post", function() {
|
|||
|
||||
equal(stagedPost.get('topic'), topic, "it assigns the topic reference");
|
||||
equal(stagedPost.get('post_number'), 2, "it is assigned the probable post_number");
|
||||
equal(postStream.get('filteredPostsCount'), 1, "it retains the filteredPostsCount");
|
||||
present(stagedPost.get('created_at'), "it is assigned a created date");
|
||||
ok(postStream.get('posts').contains(stagedPost), "the post is added to the stream");
|
||||
blank(stagedPost.get('id'), "the post has no id yet");
|
||||
equal(stagedPost.get('id'), -1, "the post has a magical -1 id");
|
||||
|
||||
// Undoing a created post (there was an error)
|
||||
postStream.undoPost(stagedPost);
|
||||
|
@ -336,7 +335,6 @@ test("staging and committing a post", function() {
|
|||
|
||||
ok(postStream.get('loading'), "it is loading while the post is being staged");
|
||||
stagedPost.setProperties({ id: 1234, raw: "different raw value" });
|
||||
equal(postStream.get('filteredPostsCount'), 1, "it retains the filteredPostsCount");
|
||||
|
||||
result = postStream.stagePost(stagedPost, user);
|
||||
equal(result, false, "you can't stage a post while it is currently staging");
|
||||
|
|
Loading…
Reference in a new issue