Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
redmine-oauth
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
MyECP
redmine-oauth
Commits
febcb9c9
Commit
febcb9c9
authored
12 years ago
by
Дмитрий Коваленок
Browse files
Options
Downloads
Patches
Plain Diff
updating Gemfile.lock
parent
a7c4fd2c
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
Gemfile
+1
-5
1 addition, 5 deletions
Gemfile
Gemfile.lock
+14
-0
14 additions, 0 deletions
Gemfile.lock
test/functional/redmine_oauth_controller_test.rb
+15
-7
15 additions, 7 deletions
test/functional/redmine_oauth_controller_test.rb
with
30 additions
and
12 deletions
Gemfile
+
1
−
5
View file @
febcb9c9
gem
'
oauth2
'
gem
'
json
'
\ No newline at end of file
group
:development
,
:test
do
gem
'
pry
'
end
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Gemfile.lock
+
14
−
0
View file @
febcb9c9
GEM
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
ruby
DEPENDENCIES
json
oauth2
This diff is collapsed.
Click to expand it.
test/functional/redmine_oauth_controller_test.rb
+
15
−
7
View file @
febcb9c9
...
...
@@ -11,19 +11,27 @@ class RedmineOauthControllerTest < ActionController::TestCase
OAuth2
::
Response
.
any_instance
.
stubs
(
body:
body
.
to_json
)
end
def
test_login_with_omniauth_for_new_user
Setting
.
self_registration
=
'3'
def
new_user
options
=
nil
user_credentials
=
{
:firstname
=>
'Cool'
,
:lastname
=>
'User'
,
:mail
=>
'user@somedomain.com'
}
User
.
where
(
user_credentials
).
delete_all
new_user
=
User
.
new
(
user_credentials
)
new_user
.
login
=
'cool_user'
:mail
=>
'user@somedomain.com'
}.
merge
(
options
)
user
=
User
.
new
(
user_credentials
)
user
.
login
=
options
[
: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
})
get
:oauth_google_callback
,
:email
=>
new_user
.
mail
assert_redirected_to
controller:
'my'
,
action:
'account'
end
def
test_login_with_invalid_oauth_provider
Setting
.
self_registration
=
'0'
end
#assert existing_user.save!
end
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment