Add jasmine test for ajax spinner display
This commit is contained in:
parent
50f32ce5ac
commit
2a52face12
2 changed files with 17 additions and 0 deletions
|
|
@ -64,6 +64,7 @@ describe AspectsController do
|
|||
end
|
||||
|
||||
it 'generates a jasmine fixture with posts', :fixture => true do
|
||||
bob.post(:status_message, :text => "Is anyone out there?", :to => @bob.aspects.first.id)
|
||||
message = alice.post(:status_message, :text => "hello "*800, :to => @alices_aspect_2.id)
|
||||
3.times { bob.comment("what", :post => message) }
|
||||
get :index
|
||||
|
|
|
|||
|
|
@ -40,6 +40,21 @@ describe("Stream", function() {
|
|||
});
|
||||
});
|
||||
|
||||
describe("streamElement", function() {
|
||||
it("makes sure that ajax spinner appears when hiding a post", function() {
|
||||
Stream.bindHideIcon();
|
||||
link = $("a.stream_element_delete.vis_hide");
|
||||
spinner = link.next("img.hide_loader");
|
||||
expect(link).not.toHaveClass("hidden");
|
||||
expect(spinner).toHaveClass("hidden");
|
||||
spyOn($, "ajax");
|
||||
link.click();
|
||||
expect($.ajax).toHaveBeenCalled();
|
||||
expect(link).toHaveClass("hidden");
|
||||
expect(spinner).not.toHaveClass("hidden");
|
||||
});
|
||||
});
|
||||
|
||||
describe("initialize", function() {
|
||||
it("calls collapseText",function(){
|
||||
spyOn(Stream, "collapseText");
|
||||
|
|
@ -71,4 +86,5 @@ describe("Stream", function() {
|
|||
expect(link.text()).toEqual("comments.show pl");
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
|
|
|
|||
Loading…
Reference in a new issue