about summary refs log tree commit diff
path: root/spec/views/stream_entries
diff options
context:
space:
mode:
authorBen Roberts <ben@thatmustbe.me>2017-04-14 20:37:00 -0400
committerEugen <eugen@zeonfederated.com>2017-04-15 02:37:00 +0200
commit89707ad0acf87d5982a0aa249db772eb888de026 (patch)
tree4660f4f6c047df7f6a6efcf3ecf4178d884f5307 /spec/views/stream_entries
parent4bebeb27d359c0fab8980b381f4a789055c980c6 (diff)
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
Diffstat (limited to 'spec/views/stream_entries')
-rw-r--r--spec/views/stream_entries/show.html.haml_spec.rb22
1 files changed, 22 insertions, 0 deletions
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
+
+