use the stream element partials for testing the StreamElement widget instead of Aspects#index

This commit is contained in:
Dan Hansen & Maxwell Salzberg 2011-11-04 18:37:41 -05:00
parent 3296477531
commit 3cfa0c4602
2 changed files with 10 additions and 2 deletions

View file

@ -96,6 +96,14 @@ describe AspectsController do
save_fixture(html_for("body"), "aspects_index_with_posts")
end
it 'generates a jasmine fixture with only posts', :fixture => true do
2.times { bob.post(:status_message, :text => "Is anyone out there?", :to => @bob.aspects.where(:name => "generic").first.id) }
get :index, :only_posts => true
save_fixture(response.body, "aspects_index_only_posts")
end
it "generates a jasmine fixture with a post with comments", :fixture => true do
message = bob.post(:status_message, :text => "HALO WHIRLED", :to => @bob.aspects.where(:name => "generic").first.id)
5.times { bob.comment("what", :post => message) }

View file

@ -8,8 +8,8 @@ describe("Diaspora.Widgets.StreamElement", function() {
beforeEach(function() {
jasmine.Clock.useMock();
spec.loadFixture("aspects_index_with_posts");
streamElement = Diaspora.BaseWidget.instantiate("StreamElement", $(".stream_element:has(a.stream_element_delete.vis_hide)"));
spec.loadFixture("aspects_index_only_posts");
streamElement = Diaspora.BaseWidget.instantiate("StreamElement", $(".stream_element").first());
});
describe("hidePost", function() {