jasmine spec for stimulating deferred searches
This commit is contained in:
parent
7d3a6a061c
commit
ee237c6c5f
2 changed files with 38 additions and 0 deletions
|
|
@ -14,5 +14,9 @@ describe PeopleController do
|
||||||
get :index
|
get :index
|
||||||
save_fixture(html_for("body"), "empty_people_search")
|
save_fixture(html_for("body"), "empty_people_search")
|
||||||
end
|
end
|
||||||
|
it "generates a jasmine fixture", :fixture => true do
|
||||||
|
get :index, :id => "sample@diaspor.us"
|
||||||
|
save_fixture(html_for("body"), "pending_external_people_search")
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
||||||
34
spec/javascripts/search-spec.js
Normal file
34
spec/javascripts/search-spec.js
Normal file
|
|
@ -0,0 +1,34 @@
|
||||||
|
/* Copyright (c) 2010-2011, Diaspora Inc. This file is
|
||||||
|
* licensed under the Affero General Public License version 3 or later. See
|
||||||
|
* the COPYRIGHT file.
|
||||||
|
*/
|
||||||
|
|
||||||
|
describe("Publisher", function() {
|
||||||
|
|
||||||
|
describe("runDelayedSearch", function() {
|
||||||
|
beforeEach( function(){
|
||||||
|
spec.loadFixture('pending_external_people_search');
|
||||||
|
Publisher.open();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('gets called on initialize', function(){
|
||||||
|
spyOn(Publisher, 'runDelayedSearch');
|
||||||
|
Publisher.initialize();
|
||||||
|
expect(Publisher.runDelayedSearch).toHaveBeenCalled();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
describe("runDelayedSearch", function() {
|
||||||
|
beforeEach( function(){
|
||||||
|
spec.loadFixture('empty_people_search');
|
||||||
|
Publisher.open();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('inserts contact html', function(){
|
||||||
|
Publisher.initialize();
|
||||||
|
Publisher.handleSearchRefresh( "<div class='testing_insert_div'>hello</div>");
|
||||||
|
expect($(".testing_insert_div").text().toEqual( "hello" ));
|
||||||
|
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
||||||
Loading…
Reference in a new issue