summaryrefslogtreecommitdiff
path: root/users/test/functional
diff options
context:
space:
mode:
authorAzul <azul@leap.se>2013-01-25 11:46:22 +0100
committerAzul <azul@leap.se>2013-01-25 11:46:22 +0100
commitdac578781baf73a006cc78e29588dd1f6fdc0fd3 (patch)
treea56ecff398a87efdd4840a8fc897d6471fbdaa69 /users/test/functional
parent75442ad26f3d30519f747bc98bc83cdc76aff750 (diff)
parent9d053b6c9b61c68bf11f95bcb37631a518f1fba4 (diff)
Merge branch 'feature/webfinger' of https://github.com/leapcode/leap_web
Conflicts: users/app/views/users/edit.html.haml
Diffstat (limited to 'users/test/functional')
-rw-r--r--users/test/functional/webfinger_controller_test.rb33
1 files changed, 33 insertions, 0 deletions
diff --git a/users/test/functional/webfinger_controller_test.rb b/users/test/functional/webfinger_controller_test.rb
new file mode 100644
index 0000000..6597b69
--- /dev/null
+++ b/users/test/functional/webfinger_controller_test.rb
@@ -0,0 +1,33 @@
+require 'test_helper'
+
+class WebfingerControllerTest < ActionController::TestCase
+
+ test "get host meta xml" do
+ get :host_meta, :format => :xml
+ assert_response :success
+ assert_equal "application/xml", response.content_type
+ end
+
+ test "get host meta json" do
+ get :host_meta, :format => :json
+ assert_response :success
+ assert_equal "application/json", response.content_type
+ end
+
+ test "get user webfinger xml" do
+ @user = stub_record :user, :public_key => 'my public key'
+ User.stubs(:find_by_login).with(@user.login).returns(@user)
+ get :search, :q => @user.email_address.to_s, :format => :xml
+ assert_response :success
+ assert_equal "application/xml", response.content_type
+ end
+
+ test "get user webfinger json" do
+ @user = stub_record :user, :public_key => 'my public key'
+ User.stubs(:find_by_login).with(@user.login).returns(@user)
+ get :search, :q => @user.email_address.to_s, :format => :json
+ assert_response :success
+ assert_equal "application/json", response.content_type
+ end
+
+end