Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
R
redmine-oauth
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
MyECP
redmine-oauth
Commits
febcb9c9
Commit
febcb9c9
authored
Nov 01, 2012
by
Дмитрий Коваленок
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
updating Gemfile.lock
parent
a7c4fd2c
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
30 additions
and
12 deletions
+30
-12
Gemfile
Gemfile
+1
-5
Gemfile.lock
Gemfile.lock
+14
-0
test/functional/redmine_oauth_controller_test.rb
test/functional/redmine_oauth_controller_test.rb
+15
-7
No files found.
Gemfile
View file @
febcb9c9
gem
'
oauth2
'
gem
'
oauth2
'
gem
'
json
'
gem
'
json
'
\ No newline at end of file
group
:development
,
:test
do
gem
'
pry
'
end
\ No newline at end of file
Gemfile.lock
View file @
febcb9c9
GEM
GEM
specs:
specs:
addressable (2.3.2)
faraday (0.7.6)
addressable (~> 2.2)
multipart-post (~> 1.1)
rack (~> 1.1)
json (1.7.5)
multi_json (1.3.6)
multipart-post (1.1.5)
oauth2 (0.5.2)
faraday (~> 0.7)
multi_json (~> 1.0)
rack (1.4.1)
PLATFORMS
PLATFORMS
ruby
ruby
DEPENDENCIES
DEPENDENCIES
json
oauth2
test/functional/redmine_oauth_controller_test.rb
View file @
febcb9c9
...
@@ -11,19 +11,27 @@ class RedmineOauthControllerTest < ActionController::TestCase
...
@@ -11,19 +11,27 @@ class RedmineOauthControllerTest < ActionController::TestCase
OAuth2
::
Response
.
any_instance
.
stubs
(
body:
body
.
to_json
)
OAuth2
::
Response
.
any_instance
.
stubs
(
body:
body
.
to_json
)
end
end
def
test_login_with_omniauth_for_new_user
def
new_user
options
=
nil
Setting
.
self_registration
=
'3'
user_credentials
=
{
:firstname
=>
'Cool'
,
user_credentials
=
{
:firstname
=>
'Cool'
,
:lastname
=>
'User'
,
:lastname
=>
'User'
,
:mail
=>
'user@somedomain.com'
}
:mail
=>
'user@somedomain.com'
}.
merge
(
options
)
User
.
where
(
user_credentials
).
delete_all
user
=
User
.
new
(
user_credentials
)
new_user
=
User
.
new
(
user_credentials
)
user
.
login
=
options
[
:login
]
||
'cool_user'
new_user
.
login
=
'cool_user'
user
end
def
test_login_with_omniauth_for_new_user
Setting
.
self_registration
=
'3'
user
set_response_body_stub
({
verified_email:
"true"
,
name:
[
new_user
.
firstname
,
new_user
.
lastname
]
*
" "
,
given_name:
new_user
.
firstname
,
family_name:
new_user
.
lastname
,
email:
new_user
.
mail
})
set_response_body_stub
({
verified_email:
"true"
,
name:
[
new_user
.
firstname
,
new_user
.
lastname
]
*
" "
,
given_name:
new_user
.
firstname
,
family_name:
new_user
.
lastname
,
email:
new_user
.
mail
})
get
:oauth_google_callback
,
:email
=>
new_user
.
mail
get
:oauth_google_callback
,
:email
=>
new_user
.
mail
assert_redirected_to
controller:
'my'
,
action:
'account'
assert_redirected_to
controller:
'my'
,
action:
'account'
end
end
def
test_login_with_invalid_oauth_provider
Setting
.
self_registration
=
'0'
end
#assert existing_user.save!
#assert existing_user.save!
end
end
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment