fixed notification specs; removed a cuke around reshares already tested in jasmine
This commit is contained in:
parent
f804db36b8
commit
71bae10317
3 changed files with 17 additions and 43 deletions
|
|
@ -65,7 +65,7 @@ class Comment < ActiveRecord::Base
|
||||||
|
|
||||||
def notification_type(user, person)
|
def notification_type(user, person)
|
||||||
if self.post.author == user.person
|
if self.post.author == user.person
|
||||||
|
return Notifications::CommentOnPost
|
||||||
elsif self.post.comments.where(:author_id => user.person.id) != [] && self.author_id != user.person.id
|
elsif self.post.comments.where(:author_id => user.person.id) != [] && self.author_id != user.person.id
|
||||||
return Notifications::AlsoCommented
|
return Notifications::AlsoCommented
|
||||||
else
|
else
|
||||||
|
|
|
||||||
|
|
@ -25,24 +25,6 @@ Feature: public repost
|
||||||
Then I should see a ".reshare"
|
Then I should see a ".reshare"
|
||||||
And I should see "Bob"
|
And I should see "Bob"
|
||||||
|
|
||||||
# (NOTE) this should be a jasmine spec
|
|
||||||
# assert that it is added to app.stream's collection
|
|
||||||
Scenario: When I reshare, it shows up in my stream
|
|
||||||
Given "bob@bob.bob" has a public post with text "reshare this!"
|
|
||||||
And I sign in as "alice@alice.alice"
|
|
||||||
And I preemptively confirm the alert
|
|
||||||
And I follow "Reshare"
|
|
||||||
And I wait for the ajax to finish
|
|
||||||
|
|
||||||
# NOTE(why do we need this to make this work?)
|
|
||||||
And I wait for 2 seconds
|
|
||||||
And I go to the home page
|
|
||||||
|
|
||||||
And I wait for the ajax to finish
|
|
||||||
Then I should see a ".reshare"
|
|
||||||
And I should see "reshare this!"
|
|
||||||
And I should see "Bob"
|
|
||||||
|
|
||||||
# (NOTE) this should be a jasmine spec
|
# (NOTE) this should be a jasmine spec
|
||||||
Scenario: I can see the number of reshares
|
Scenario: I can see the number of reshares
|
||||||
Given "bob@bob.bob" has a public post with text "reshare this!"
|
Given "bob@bob.bob" has a public post with text "reshare this!"
|
||||||
|
|
@ -51,15 +33,7 @@ Feature: public repost
|
||||||
And I preemptively confirm the alert
|
And I preemptively confirm the alert
|
||||||
And I follow "Reshare"
|
And I follow "Reshare"
|
||||||
|
|
||||||
# NOTE(why do we need this to make this work?)
|
|
||||||
And I wait for 2 seconds
|
|
||||||
When I go to the home page
|
|
||||||
|
|
||||||
Then I should see a ".reshare"
|
|
||||||
And I should see "reshare this!"
|
|
||||||
And I should see "Bob"
|
|
||||||
|
|
||||||
# NOTE(why do we need this to make this work?)
|
|
||||||
And I wait for 2 seconds
|
And I wait for 2 seconds
|
||||||
When I go to the home page
|
When I go to the home page
|
||||||
|
And I wait for the ajax to finish
|
||||||
Then I should see "1 reshare"
|
Then I should see "1 reshare"
|
||||||
|
|
|
||||||
|
|
@ -113,8 +113,9 @@ describe("app.views.Feedback", function(){
|
||||||
expect($(this.view.el).html()).not.toContain('reshare_action')
|
expect($(this.view.el).html()).not.toContain('reshare_action')
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
})
|
||||||
|
|
||||||
context("reshares", function(){
|
describe("resharePost", function(){
|
||||||
beforeEach(function(){
|
beforeEach(function(){
|
||||||
this.post.attributes.public = true
|
this.post.attributes.public = true
|
||||||
this.post.attributes.root = {author : {name : "susan"}};
|
this.post.attributes.root = {author : {name : "susan"}};
|
||||||
|
|
@ -135,5 +136,4 @@ describe("app.views.Feedback", function(){
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
})
|
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue