forked from publiclab/plots2
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
initial tag debug fixing publiclab#801
- Loading branch information
Showing
4 changed files
with
83 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
<span id="tags"> | ||
<span id="tag_1" class="label label-primary" data-toggle="tooltip" data-html="true"> | ||
<a href="/tag/blog">blog</a> | ||
<a class="tag-delete" data-remote="true" href="/tag/delete/2/1" data-tag-id="1">x</a> | ||
</span> | ||
</span> | ||
|
||
<form id="tagform" class="form" data-remote="true" action="/tag/create/<%= @node.id %>"> | ||
<input name="remote" type="hidden" value="true" /> | ||
<input autocomplete="off" class="tag-input form-control" name="name" type="text" data-provide="typeahead" /> | ||
</form> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
//= require application | ||
//= require jasmine-jquery | ||
//= require tagging | ||
|
||
var editor; | ||
|
||
describe("Tagging", function() { | ||
|
||
beforeAll(function() { | ||
|
||
// for phantomjs running | ||
jasmine.getFixtures().fixturesPath="../../spec/javascripts/fixtures"; | ||
|
||
loadFixtures('tagging.html'); | ||
|
||
initTagForm(2); | ||
|
||
}); | ||
|
||
|
||
// this should test addTag(tagname, selector) from tagging.js, which is an ajax request | ||
xit("tests tag deletion", function() { | ||
|
||
$('tags.label:first a.tag-delete').trigger('click'); | ||
|
||
setTimeout(0, function() { | ||
|
||
// expect tag to be greyed out | ||
expect($('tags.label:first a.tag-delete').css('opacity')).toBe(0.5); | ||
|
||
}); | ||
|
||
|
||
}); | ||
|
||
|
||
// this should test addTag(tagname, selector) from tagging.js, which is an ajax request | ||
xit("adds a tag", function(done) { | ||
|
||
addTag('boss'); | ||
|
||
el.bind('ajax:success', function(e, response){ | ||
|
||
// drop the test expectations to the bottom of the task queue | ||
setTimeout(0, function() { | ||
|
||
// assert tag properly constructed here | ||
// expect($('#tag_...).toBe(true); | ||
|
||
done(); | ||
|
||
}); | ||
|
||
}); | ||
|
||
}); |