Merge pull request #86 from rossta/bug_fix_twitter_complete

Twitter oauth login failing: fix for javascript error
This commit is contained in:
Robin Ward 2013-02-08 15:56:43 -08:00
commit ea631e75c9
3 changed files with 45 additions and 0 deletions

View 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

View 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

View 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