MS; Fix fake following, as we took it out so I nuked the tests
This commit is contained in:
parent
c6b8d75313
commit
120c6b46e0
2 changed files with 1 additions and 55 deletions
|
|
@ -51,9 +51,7 @@ app.pages.Profile = app.views.Base.extend({
|
||||||
var bio = this.model.get("bio") || ''
|
var bio = this.model.get("bio") || ''
|
||||||
|
|
||||||
return _.extend(this.defaultPresenter(),
|
return _.extend(this.defaultPresenter(),
|
||||||
{text : this.model && app.helpers.textFormatter(bio, this.model),
|
{text : this.model && app.helpers.textFormatter(bio, this.model) })
|
||||||
showFollowButton : this.showFollowButton()
|
|
||||||
})
|
|
||||||
},
|
},
|
||||||
|
|
||||||
pulsateNewPostControl : function() {
|
pulsateNewPostControl : function() {
|
||||||
|
|
@ -115,13 +113,4 @@ app.pages.Profile = app.views.Base.extend({
|
||||||
if(!confirm("Are you sure you want to log out?"))
|
if(!confirm("Are you sure you want to log out?"))
|
||||||
evt.preventDefault();
|
evt.preventDefault();
|
||||||
},
|
},
|
||||||
|
|
||||||
followingEnabled : function() {
|
|
||||||
var user = app.currentUser
|
|
||||||
return user.get("following_count") != 0 && user.get("diaspora_id") !== undefined
|
|
||||||
},
|
|
||||||
|
|
||||||
showFollowButton : function() {
|
|
||||||
return this.followingEnabled() && !this.model.get("is_own_profile")
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
|
||||||
|
|
@ -63,18 +63,6 @@ describe("app.pages.Profile", function(){
|
||||||
this.page.render()
|
this.page.render()
|
||||||
expect(this.page.$("#profile-controls .control").length).toBe(2)
|
expect(this.page.$("#profile-controls .control").length).toBe(2)
|
||||||
})
|
})
|
||||||
|
|
||||||
it("shows a follow button if showFollowButton returns true", function() {
|
|
||||||
spyOn(this.page, "showFollowButton").andReturn(true)
|
|
||||||
this.page.render()
|
|
||||||
expect(this.page.$("#follow-button").length).toBe(1)
|
|
||||||
})
|
|
||||||
|
|
||||||
it("doesn't show a follow button if showFollowButton returns false", function() {
|
|
||||||
spyOn(this.page, "showFollowButton").andReturn(false)
|
|
||||||
this.page.render()
|
|
||||||
expect(this.page.$("#follow-button").length).toBe(0)
|
|
||||||
})
|
|
||||||
})
|
})
|
||||||
|
|
||||||
context("clicking fav", function(){
|
context("clicking fav", function(){
|
||||||
|
|
@ -170,35 +158,4 @@ describe("app.pages.Profile", function(){
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
});
|
});
|
||||||
|
|
||||||
describe("followingEnabled", function(){
|
|
||||||
/* for legacy beta testers */
|
|
||||||
it("returns false if following_count is zero", function(){
|
|
||||||
loginAs({following_count : 0})
|
|
||||||
expect(this.page.followingEnabled()).toBeFalsy()
|
|
||||||
})
|
|
||||||
|
|
||||||
it("returns false if the user is not signed in", function(){
|
|
||||||
logout()
|
|
||||||
expect(this.page.followingEnabled()).toBeFalsy()
|
|
||||||
})
|
|
||||||
|
|
||||||
it("returns false if following_count is zero", function(){
|
|
||||||
loginAs({following_count : 1})
|
|
||||||
expect(this.page.followingEnabled()).toBeTruthy()
|
|
||||||
})
|
|
||||||
})
|
|
||||||
|
|
||||||
describe("followingEnabled", function(){
|
|
||||||
/* for legacy beta testers */
|
|
||||||
it("returns false if following_count is zero", function(){
|
|
||||||
app.currentUser.set({following_count : 0})
|
|
||||||
expect(this.page.followingEnabled()).toBeFalsy()
|
|
||||||
})
|
|
||||||
|
|
||||||
it("returns false if following_count is zero", function(){
|
|
||||||
app.currentUser.set({following_count : 1})
|
|
||||||
expect(this.page.followingEnabled()).toBeTruthy()
|
|
||||||
})
|
|
||||||
})
|
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue