Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
sample_app
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Đường Sỹ Hoàng
sample_app
Commits
66ea702f
Commit
66ea702f
authored
Nov 19, 2019
by
Đường Sỹ Hoàng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixed space
parent
e20d4aca
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
5 deletions
+5
-5
test/controllers/users_controller_test.rb
+2
-2
test/integration/users_edit_test.rb
+3
-3
No files found.
test/controllers/users_controller_test.rb
View file @
66ea702f
...
...
@@ -25,7 +25,7 @@ class UsersControllerTest < ActionDispatch::IntegrationTest
test
"should redirect update when logged in as wrong user"
do
log_in_as
(
@other_user
)
patch
user_path
(
@user
),
params:
{
user:
{
name:
@user
.
name
,
email:
@user
.
email
}
}
patch
user_path
(
@user
),
params:
{
user:
{
name:
@user
.
name
,
email:
@user
.
email
}
}
assert
flash
.
empty?
assert_redirected_to
root_url
end
...
...
@@ -39,7 +39,7 @@ class UsersControllerTest < ActionDispatch::IntegrationTest
test
"should not allow the admin attribute to be edited via the web"
do
log_in_as
(
@other_user
)
assert_not
@other_user
.
admin?
patch
user_path
(
@other_user
),
params:
{
user
:{
password:
@other_user
.
password
,
password_confirmation:
@other_user
.
password
,
admin:
true
}
}
patch
user_path
(
@other_user
),
params:
{
user
:{
password:
@other_user
.
password
,
password_confirmation:
@other_user
.
password
,
admin:
true
}
}
assert_not
@other_user
.
reload
.
admin?
end
end
test/integration/users_edit_test.rb
View file @
66ea702f
...
...
@@ -10,7 +10,7 @@ class UsersEditTest < ActionDispatch::IntegrationTest
log_in_as
(
@user
)
get
edit_user_path
(
@user
)
assert_template
"users/edit"
patch
user_path
(
@user
),
params:
{
user:
{
name:
""
,
email:
"foo@invalid"
,
password:
"foo"
,
password_confirmation:
"bar"
}
}
patch
user_path
(
@user
),
params:
{
user:
{
name:
""
,
email:
"foo@invalid"
,
password:
"foo"
,
password_confirmation:
"bar"
}
}
assert_template
"users/edit"
end
...
...
@@ -20,7 +20,7 @@ class UsersEditTest < ActionDispatch::IntegrationTest
assert_template
"users/edit"
name
=
"Foo Bar"
email
=
"foo@bar.com"
patch
user_path
(
@user
),
params:
{
user:
{
name:
name
,
email:
email
,
password:
""
,
password_confirmation:
""
}
}
patch
user_path
(
@user
),
params:
{
user:
{
name:
name
,
email:
email
,
password:
""
,
password_confirmation:
""
}
}
assert_not
flash
.
empty?
assert_redirected_to
@user
@user
.
reload
...
...
@@ -34,7 +34,7 @@ class UsersEditTest < ActionDispatch::IntegrationTest
assert_redirected_to
edit_user_url
(
@user
)
name
=
"Foo Bar"
email
=
"foo@bar.com"
patch
user_path
(
@user
),
params:
{
user:
{
name:
name
,
email:
email
,
password
:""
,
password_confirmation:
""
}
}
patch
user_path
(
@user
),
params:
{
user:
{
name:
name
,
email:
email
,
password
:""
,
password_confirmation:
""
}
}
assert_not
flash
.
empty?
assert_redirected_to
@user
@user
.
reload
...
...
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