Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/diaspora/diaspora.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'spec/javascripts/app/views/comment_view_spec.js')
-rw-r--r--spec/javascripts/app/views/comment_view_spec.js8
1 files changed, 6 insertions, 2 deletions
diff --git a/spec/javascripts/app/views/comment_view_spec.js b/spec/javascripts/app/views/comment_view_spec.js
index fc5a633cf..fb73ff190 100644
--- a/spec/javascripts/app/views/comment_view_spec.js
+++ b/spec/javascripts/app/views/comment_view_spec.js
@@ -1,11 +1,11 @@
describe("app.views.Comment", function(){
- beforeEach(function(){
+ beforeEach(function() {
this.post = factory.post({author : {diaspora_id : "xxx@xxx.xxx"}});
this.comment = factory.comment({parent : this.post.toJSON()});
this.view = new app.views.Comment({model : this.comment});
});
- describe("render", function(){
+ describe("render", function() {
it("has a delete link if the author is the current user", function(){
loginAs(this.comment.get("author"));
expect(this.view.render().$('.delete').length).toBe(1);
@@ -47,6 +47,10 @@ describe("app.views.Comment", function(){
});
describe("canRemove", function(){
+ beforeEach(function() {
+ loginAs({name: "alice"});
+ });
+
context("is truthy", function(){
it("when ownComment is true", function(){
spyOn(this.view, "ownComment").and.returnValue(true);