From 89707ad0acf87d5982a0aa249db772eb888de026 Mon Sep 17 00:00:00 2001 From: Ben Roberts Date: Fri, 14 Apr 2017 20:37:00 -0400 Subject: add basic microformats tests (#1803) as suggested, moving to view tests rather than a controller test replaces https://github.com/tootsuite/mastodon/pull/1786 which i will close momentary --- spec/views/stream_entries/show.html.haml_spec.rb | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100644 spec/views/stream_entries/show.html.haml_spec.rb (limited to 'spec/views/stream_entries') diff --git a/spec/views/stream_entries/show.html.haml_spec.rb b/spec/views/stream_entries/show.html.haml_spec.rb new file mode 100644 index 000000000..18814e785 --- /dev/null +++ b/spec/views/stream_entries/show.html.haml_spec.rb @@ -0,0 +1,22 @@ +require 'rails_helper' + +describe "accounts/show.html.haml" do + + it "has an h-feed with correct number of h-entry objects in it" do + alice = Fabricate(:account, username: 'alice', display_name: 'Alice') + status = Fabricate(:status, account: alice, text: 'Hello World') + status2 = Fabricate(:status, account: alice, text: 'Hello World Again') + status3 = Fabricate(:status, account: alice, text: 'Are You Still There World?') + + assign(:account, alice) + assign(:statuses, alice.statuses) + + render(:template => 'accounts/show.html.haml') + + expect(Nokogiri::HTML(rendered).search('.h-feed .h-entry').size).to eq 3 + + end + +end + + -- cgit