blob: 6597b698b3099ebc72f095c3d451d69d47ace20b (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
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
|