Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
pleroma
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
Container Registry
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
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Alex Gleason
pleroma
Commits
bf181ca9
Verified
Commit
bf181ca9
authored
4 years ago
by
Alex Gleason
Browse files
Options
Downloads
Patches
Plain Diff
Fix MastoAPI.AuthControllerTest, json_response(:no_content) --> empty_json_response()
parent
0b728ccc
Branches
emoji-upload
No related tags found
No related merge requests found
Pipeline
#31282
passed
4 years ago
Stage: build
Stage: test
Stage: benchmark
Stage: deploy
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
test/web/mastodon_api/controllers/auth_controller_test.exs
+6
-9
6 additions, 9 deletions
test/web/mastodon_api/controllers/auth_controller_test.exs
with
6 additions
and
9 deletions
test/web/mastodon_api/controllers/auth_controller_test.exs
+
6
−
9
View file @
bf181ca9
...
...
@@ -61,7 +61,7 @@ test "redirects to the getting-started page when referer is not present", %{conn
end
test
"it returns 204"
,
%{
conn:
conn
}
do
assert
json_response
(
conn
,
:no_content
)
assert
empty_
json_response
(
conn
)
end
test
"it creates a PasswordResetToken record for user"
,
%{
user:
user
}
do
...
...
@@ -91,7 +91,7 @@ test "it returns 204", %{conn: conn} do
assert
conn
|>
post
(
"/auth/password?nickname=
#{
user
.
nickname
}
"
)
|>
json_response
(
:no_content
)
|>
empty_
json_response
()
ObanHelpers
.
perform_all
()
token_record
=
Repo
.
get_by
(
Pleroma
.
PasswordResetToken
,
user_id:
user
.
id
)
...
...
@@ -112,7 +112,7 @@ test "it doesn't fail when a user has no email", %{conn: conn} do
assert
conn
|>
post
(
"/auth/password?nickname=
#{
user
.
nickname
}
"
)
|>
json_response
(
:no_content
)
|>
empty_
json_response
()
end
end
...
...
@@ -125,24 +125,21 @@ test "it doesn't fail when a user has no email", %{conn: conn} do
test
"it returns 204 when user is not found"
,
%{
conn:
conn
,
user:
user
}
do
conn
=
post
(
conn
,
"/auth/password?email=nonexisting_
#{
user
.
email
}
"
)
assert
conn
|>
json_response
(
:no_content
)
assert
empty_json_response
(
conn
)
end
test
"it returns 204 when user is not local"
,
%{
conn:
conn
,
user:
user
}
do
{
:ok
,
user
}
=
Repo
.
update
(
Ecto
.
Changeset
.
change
(
user
,
local:
false
))
conn
=
post
(
conn
,
"/auth/password?email=
#{
user
.
email
}
"
)
assert
conn
|>
json_response
(
:no_content
)
assert
empty_json_response
(
conn
)
end
test
"it returns 204 when user is deactivated"
,
%{
conn:
conn
,
user:
user
}
do
{
:ok
,
user
}
=
Repo
.
update
(
Ecto
.
Changeset
.
change
(
user
,
deactivated:
true
,
local:
true
))
conn
=
post
(
conn
,
"/auth/password?email=
#{
user
.
email
}
"
)
assert
conn
|>
json_response
(
:no_content
)
assert
empty_json_response
(
conn
)
end
end
...
...
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