Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Pleroma
pleroma
Commits
91065e19
Commit
91065e19
authored
Dec 02, 2018
by
lain
Browse files
Fix background updating / handling.
parent
371d96b1
Changes
3
Hide whitespace changes
Inline
Side-by-side
lib/pleroma/user/info.ex
View file @
91065e19
...
...
@@ -4,7 +4,7 @@ defmodule Pleroma.User.Info do
embedded_schema
do
field
(
:banner
,
:map
,
default:
%{})
field
(
:background
,
:
string
,
default:
nil
)
field
(
:background
,
:
map
,
default:
%{}
)
field
(
:source_data
,
:map
,
default:
%{})
field
(
:note_count
,
:integer
,
default:
0
)
field
(
:follower_count
,
:integer
,
default:
0
)
...
...
@@ -134,7 +134,8 @@ def profile_update(info, params) do
:locked
,
:no_rich_text
,
:default_scope
,
:banner
:banner
,
:background
])
end
...
...
test/web/ostatus/ostatus_test.exs
View file @
91065e19
...
...
@@ -337,7 +337,7 @@ test "find_or_make_user sets all the nessary input fields" do
%
Pleroma
.
User
.
Info
{
id:
user
.
info
.
id
,
ap_enabled:
false
,
background:
nil
,
background:
%{}
,
banner:
%{},
blocks:
[],
deactivated:
false
,
...
...
test/web/twitter_api/twitter_api_controller_test.exs
View file @
91065e19
...
...
@@ -24,6 +24,9 @@ test "it updates the banner", %{conn: conn} do
|>
assign
(
:user
,
user
)
|>
post
(
authenticated_twitter_api__path
(
conn
,
:update_banner
),
%{
"banner"
=>
new_banner
})
|>
json_response
(
200
)
user
=
Repo
.
get
(
User
,
user
.
id
)
assert
user
.
info
.
banner
[
"type"
]
==
"Image"
end
end
...
...
@@ -39,6 +42,9 @@ test "it updates the background", %{conn: conn} do
|>
assign
(
:user
,
user
)
|>
post
(
authenticated_twitter_api__path
(
conn
,
:update_background
),
%{
"img"
=>
new_bg
})
|>
json_response
(
200
)
user
=
Repo
.
get
(
User
,
user
.
id
)
assert
user
.
info
.
background
[
"type"
]
==
"Image"
end
end
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment