mirror of
https://github.com/discourse/discourse.git
synced 2025-09-05 08:59:27 +08:00
add cas support with a few tests
This commit is contained in:
parent
0f296cd42b
commit
1575ce7b10
15 changed files with 145 additions and 2 deletions
|
@ -13,6 +13,18 @@ describe "users/omniauth_callbacks/complete.html.erb" do
|
|||
rendered_data["awaiting_activation"].should eq(true)
|
||||
end
|
||||
|
||||
it "renders cas data " do
|
||||
assign(:data, {username: "username", :auth_provider=> "CAS", :awaiting_activation=>true})
|
||||
|
||||
render
|
||||
|
||||
rendered_data = JSON.parse(rendered.match(/window.opener.Discourse.authenticationComplete\((.*)\)/)[1])
|
||||
|
||||
rendered_data["username"].should eq("username")
|
||||
rendered_data["auth_provider"].should eq("CAS")
|
||||
rendered_data["awaiting_activation"].should eq(true)
|
||||
end
|
||||
|
||||
it "renders twitter data " do
|
||||
assign(:data, {username: "username", :auth_provider=>"Twitter", :awaiting_activation=>true})
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue