Better stab at the jasmine test.
This commit is contained in:
parent
2716316dac
commit
6cf42fb8ba
2 changed files with 8 additions and 3 deletions
|
|
@ -289,7 +289,7 @@ var Publisher = {
|
||||||
bindPublicIcon: function(){
|
bindPublicIcon: function(){
|
||||||
$(".public_icon").bind("click", function(evt){
|
$(".public_icon").bind("click", function(evt){
|
||||||
$(this).toggleClass("dim");
|
$(this).toggleClass("dim");
|
||||||
var public_field= $("#publisher #status_message_public");
|
var public_field = $("#publisher #status_message_public");
|
||||||
|
|
||||||
if (public_field.val() == 'false') {
|
if (public_field.val() == 'false') {
|
||||||
public_field.val('true');
|
public_field.val('true');
|
||||||
|
|
|
||||||
|
|
@ -110,6 +110,9 @@ describe("Publisher", function() {
|
||||||
describe("bindPublicIcon", function() {
|
describe("bindPublicIcon", function() {
|
||||||
beforeEach( function(){
|
beforeEach( function(){
|
||||||
spec.loadFixture('aspects_index_services');
|
spec.loadFixture('aspects_index_services');
|
||||||
|
Diaspora.widgets.i18n.loadLocale(
|
||||||
|
{ 'publisher' :
|
||||||
|
{ 'public' : 'is public', 'limited' : 'is limited' } }, 'en');
|
||||||
});
|
});
|
||||||
|
|
||||||
it('gets called on initialize', function(){
|
it('gets called on initialize', function(){
|
||||||
|
|
@ -134,10 +137,12 @@ describe("Publisher", function() {
|
||||||
});
|
});
|
||||||
it('toggles the tooltip on the clicked icon', function(){
|
it('toggles the tooltip on the clicked icon', function(){
|
||||||
Publisher.bindPublicIcon();
|
Publisher.bindPublicIcon();
|
||||||
|
expect($(".public_icon")).toHaveAttr('title', 'is public');
|
||||||
|
|
||||||
$(".public_icon").click();
|
$(".public_icon").click();
|
||||||
expect($(".public_icon")).toHaveAttr('title', Diaspora.widgets.i18n.t('javascripts.publisher.limited'));
|
expect($(".public_icon")).toHaveAttr('title', 'is limited');
|
||||||
$(".public_icon").click();
|
$(".public_icon").click();
|
||||||
expect($(".public_icon")).toHaveAttr('title', Diaspora.widgets.i18n.t('javascripts.publisher.public'));
|
expect($(".public_icon")).toHaveAttr('title', 'is public');
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
describe("bindServiceIcons", function() {
|
describe("bindServiceIcons", function() {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue