summaryrefslogtreecommitdiff
path: root/users/test/unit/webfinger
diff options
context:
space:
mode:
Diffstat (limited to 'users/test/unit/webfinger')
-rw-r--r--users/test/unit/webfinger/.user_presenter_test.rb.swpbin12288 -> 0 bytes
-rw-r--r--users/test/unit/webfinger/host_meta_presenter_test.rb24
2 files changed, 24 insertions, 0 deletions
diff --git a/users/test/unit/webfinger/.user_presenter_test.rb.swp b/users/test/unit/webfinger/.user_presenter_test.rb.swp
deleted file mode 100644
index 5b92867..0000000
--- a/users/test/unit/webfinger/.user_presenter_test.rb.swp
+++ /dev/null
Binary files differ
diff --git a/users/test/unit/webfinger/host_meta_presenter_test.rb b/users/test/unit/webfinger/host_meta_presenter_test.rb
new file mode 100644
index 0000000..af86404
--- /dev/null
+++ b/users/test/unit/webfinger/host_meta_presenter_test.rb
@@ -0,0 +1,24 @@
+require 'test_helper'
+require 'webfinger'
+require 'json'
+
+class Webfinger::HostMetaPresenterTest < ActiveSupport::TestCase
+
+ setup do
+ @request = stub(
+ url: "https://#{APP_CONFIG[:domain]}/.well-known/host-meta"
+ )
+ @meta = Webfinger::HostMetaPresenter.new(@request)
+ end
+
+ test "creates proper json" do
+ hash = JSON.parse @meta.to_json
+ assert_equal ["subject", "links"].sort, hash.keys.sort
+ hash.each do |key, value|
+ assert_equal @meta.send(key.to_sym).to_json, value.to_json
+ end
+ end
+
+end
+
+