Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
D
diaspora
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
Requirements
Requirements
List
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Operations
Operations
Environments
Packages & Registries
Packages & Registries
Package Registry
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issue
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
diasporg
diaspora
Commits
6804132c
Unverified
Commit
6804132c
authored
Oct 28, 2018
by
flaburgan
Committed by
Benjamin Neff
Jan 06, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Do not autofollow back a user you are ignoring
fixes #7808 closes #7913
parent
58d2ce7b
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
63 additions
and
11 deletions
+63
-11
Changelog.md
Changelog.md
+1
-0
app/models/user/connecting.rb
app/models/user/connecting.rb
+2
-0
features/desktop/auto_follow_back.feature
features/desktop/auto_follow_back.feature
+36
-0
features/step_definitions/aspects_steps.rb
features/step_definitions/aspects_steps.rb
+24
-0
features/step_definitions/user_steps.rb
features/step_definitions/user_steps.rb
+0
-11
No files found.
Changelog.md
View file @
6804132c
...
...
@@ -4,6 +4,7 @@
*
Improve public stream performance and cleanup unused indexes
[
#7944
](
https://github.com/diaspora/diaspora/pull/7944
)
## Bug fixes
*
Do not autofollow back a user you are ignoring
[
#7913
](
https://github.com/diaspora/diaspora/pull/7913
)
## Features
*
Suppoert ignore users on mobile
[
#7884
](
https://github.com/diaspora/diaspora/pull/7884
)
...
...
app/models/user/connecting.rb
View file @
6804132c
...
...
@@ -11,6 +11,8 @@ class User
# @param [Aspect] aspect The aspect to add them to.
# @return [Contact] The newly made contact for the passed in person.
def
share_with
(
person
,
aspect
)
return
if
blocks
.
where
(
person_id:
person
.
id
).
exists?
contact
=
contacts
.
find_or_initialize_by
(
person_id:
person
.
id
)
return
false
unless
contact
.
valid?
...
...
features/desktop/auto_follow_back.feature
0 → 100644
View file @
6804132c
@javascript
Feature
:
auto follow back a user
Background
:
Given following users exist
:
|
username
|
email
|
|
Bob
Jones
|
bob@bob.bob
|
|
Alice
Smith
|
alice@alice.alice
|
And
I sign in as
"bob@bob.bob"
And
I have an aspect called
"My main aspect"
And
I have an aspect called
"Others"
with auto follow back
And
I sign out
Scenario
:
When
a user with auto follow back enabled is shared with, he's sharing back
When
I sign in as
"alice@alice.alice"
And
I am on
"bob@bob.bob"
's page
And
I add the person to my
"Besties"
aspect
And
I sign out
And
I sign in as
"bob@bob.bob"
Then
I should have 1 contact in
"Others"
When
I am on
"alice@alice.alice"
's page
Then
I should see
"Others"
within the contact aspect dropdown
Scenario
:
When
a user with auto follow back enabled is shared with by a user he's ignoring, he's not sharing back
When
I sign in as
"bob@bob.bob"
And
I am on
"alice@alice.alice"
's page
And
I click on the profile block button
And
I sign out
When
I sign in as
"alice@alice.alice"
And
I am on
"bob@bob.bob"
's page
And
I add the person to my
"Besties"
aspect
And
I sign out
And
I sign in as
"bob@bob.bob"
Then
I should have 0 contact in
"Others"
When
I am on
"alice@alice.alice"
's page
Then
I should see
"Stop ignoring"
within
"#unblock_user_button"
features/step_definitions/aspects_steps.rb
View file @
6804132c
...
...
@@ -38,6 +38,26 @@ module AspectCukeHelpers
end
World
(
AspectCukeHelpers
)
Given
/^I have an aspect called "([^\"]*)"$/
do
|
aspect_name
|
@me
.
aspects
.
create!
(
name:
aspect_name
)
@me
.
reload
end
Given
/^I have an aspect called "([^\"]*)" with auto follow back$/
do
|
aspect_name
|
aspect
=
@me
.
aspects
.
create!
(
name:
aspect_name
)
@me
.
auto_follow_back
=
true
@me
.
auto_follow_back_aspect
=
aspect
@me
.
save
@me
.
reload
end
Given
/^I have following aspect[s]?:$/
do
|
fields
|
fields
.
raw
.
each
do
|
field
|
@me
.
aspects
.
create!
(
name:
field
[
0
])
end
@me
.
reload
end
When
/^I click on "([^"]*)" aspect edit icon$/
do
|
aspect_name
|
within
(
".all-aspects"
)
do
li
=
find
(
'li'
,
text:
aspect_name
)
...
...
@@ -112,6 +132,10 @@ And /^I toggle the aspect "([^"]*)"$/ do |name|
toggle_aspect
(
name
)
end
Then
/^I should see "([^"]*)" within the contact aspect dropdown$/
do
|
aspect_name
|
expect
(
find
(
".dropdown-toggle .text"
)).
to
have_content
aspect_name
end
Then
/^I should see "([^"]*)" aspect selected$/
do
|
aspect_name
|
aspect
=
@me
.
aspects
.
where
(
:name
=>
aspect_name
).
first
within
(
"#aspects_list"
)
do
...
...
features/step_definitions/user_steps.rb
View file @
6804132c
...
...
@@ -72,17 +72,6 @@ When /^I click on my name$/ do
click_link
(
"
#{
@me
.
first_name
}
#{
@me
.
last_name
}
"
)
end
Given
/^I have an aspect called "([^\"]*)"$/
do
|
aspect_name
|
@me
.
aspects
.
create!
(
:name
=>
aspect_name
)
@me
.
reload
end
Given
/^I have following aspect[s]?:$/
do
|
fields
|
fields
.
raw
.
each
do
|
field
|
step
%{I have an aspect called "#{field[0]}"}
end
end
When
/^I have user with username "([^"]*)" in an aspect called "([^"]*)"$/
do
|
username
,
aspect
|
user
=
User
.
find_by_username
(
username
)
contact
=
@me
.
reload
.
contact_for
(
user
.
person
)
...
...
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