mirror of
https://github.com/codeninjasllc/discourse.git
synced 2024-11-27 09:36:19 -05:00
move 3 test to 1
This commit is contained in:
parent
9189d937f7
commit
f232c646a7
4 changed files with 43 additions and 45 deletions
|
@ -1,15 +0,0 @@
|
|||
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
|
43
spec/views/omniauth_callbacks/complete.html.erb_spec.rb
Normal file
43
spec/views/omniauth_callbacks/complete.html.erb_spec.rb
Normal file
|
@ -0,0 +1,43 @@
|
|||
require "spec_helper"
|
||||
|
||||
describe "users/omniauth_callbacks/complete.html.erb" do
|
||||
it "renders facebook 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
|
||||
|
||||
it "renders twitter 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
|
||||
|
||||
|
||||
it "renders openid 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
|
||||
|
||||
|
|
@ -1,15 +0,0 @@
|
|||
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
|
|
@ -1,15 +0,0 @@
|
|||
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