Skip to content

Commit

Permalink
Tests for not displaying uid
Browse files Browse the repository at this point in the history
  • Loading branch information
SidharthBansal committed Jul 24, 2018
1 parent 5574837 commit 02e1dbf
Showing 1 changed file with 37 additions and 0 deletions.
37 changes: 37 additions & 0 deletions test/functional/user_tags_controller_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -129,4 +129,41 @@ def setup
assert_template 'user_tags/index'
end

test 'Oauth tags are in form of oauth:provider for github' do
UserSession.create(users(:jeff))
user = users(:jeff)
auth = { "provider" => "github", "uid" => "123456789"}
uid = user.id
identity = UserTag.create_with_omniauth(auth, uid)
assert_select 'oauth:github', identity.value
end

test 'Oauth tags are in form of oauth:provider for twitter' do
UserSession.create(users(:jeff))
user = users(:jeff)
auth = { "provider" => "twitter", "uid" => "123456789"}
uid = user.id
identity = UserTag.create_with_omniauth(auth, uid)
get :profile, controller: user
assert_equal 'oauth:twitter', identity.value
end

test 'Oauth tags are in form of oauth:provider for google' do
UserSession.create(users(:jeff))
user = users(:jeff)
auth = { "provider" => "google_oauth2", "uid" => "123456789"}
uid = user.id
identity = UserTag.create_with_omniauth(auth, uid)
assert_select 'oauth:google_oauth2', identity.value
end

test 'Oauth tags are in form of oauth:provider for facebook' do
UserSession.create(users(:jeff))
user = users(:jeff)
auth = { "provider" => "facebook", "uid" => "123456789"}
uid = user.id
identity = UserTag.create_with_omniauth(auth, uid)
assert_select 'oauth:facebook', identity.value
end

end

0 comments on commit 02e1dbf

Please sign in to comment.