mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-27 17:46:05 -05:00
html safe json data for twitter/complete with view specs
This commit is contained in:
parent
33757c201a
commit
c959f8a67e
3 changed files with 45 additions and 0 deletions
15
spec/views/facebook/complete.html.erb_spec.rb
Normal file
15
spec/views/facebook/complete.html.erb_spec.rb
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
require "spec_helper"
|
||||||
|
|
||||||
|
describe "facebook/complete.html.erb" do
|
||||||
|
it "renders data " do
|
||||||
|
assign(:data, {:username =>"username", :auth_provider=>"Facebook", :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("Facebook")
|
||||||
|
rendered_data["awaiting_activation"].should eq(true)
|
||||||
|
end
|
||||||
|
end
|
15
spec/views/twitter/complete.html.erb_spec.rb
Normal file
15
spec/views/twitter/complete.html.erb_spec.rb
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
require "spec_helper"
|
||||||
|
|
||||||
|
describe "twitter/complete.html.erb" do
|
||||||
|
it "renders data " do
|
||||||
|
assign(:data, {:username =>"username", :auth_provider=>"Twitter", :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("Twitter")
|
||||||
|
rendered_data["awaiting_activation"].should eq(true)
|
||||||
|
end
|
||||||
|
end
|
15
spec/views/user_open_ids/complete.html.erb_spec.rb
Normal file
15
spec/views/user_open_ids/complete.html.erb_spec.rb
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
require "spec_helper"
|
||||||
|
|
||||||
|
describe "user_open_ids/complete.html.erb" do
|
||||||
|
it "renders data " do
|
||||||
|
assign(:data, {:username =>"username", :auth_provider=>"OpenId", :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("OpenId")
|
||||||
|
rendered_data["awaiting_activation"].should eq(true)
|
||||||
|
end
|
||||||
|
end
|
Loading…
Reference in a new issue