Merge branch 'Ruxton-feature/autofollow_any_user' into develop
This commit is contained in:
commit
d4b5261ba0
5 changed files with 28 additions and 17 deletions
|
|
@ -14,6 +14,7 @@
|
|||
* Admin: add option to find users under 13 (COPPA) [#4252](https://github.com/diaspora/diaspora/pull/4252)
|
||||
* Show the user if a contact is sharing with them when viewing their profile page [#2948](https://github.com/diaspora/diaspora/issues/2948)
|
||||
* Made Unicorn timeout configurable and increased the default to 90 seconds
|
||||
* Follow DiasporaHQ upon account creation is now configurable to another account [#4278](https://github.com/diaspora/diaspora/pull/4278)
|
||||
|
||||
# 0.1.1.0
|
||||
|
||||
|
|
|
|||
|
|
@ -391,8 +391,8 @@ class User < ActiveRecord::Base
|
|||
self.aspects.create(:name => I18n.t('aspects.seed.work'))
|
||||
aq = self.aspects.create(:name => I18n.t('aspects.seed.acquaintances'))
|
||||
|
||||
if AppConfig.settings.follow_diasporahq?
|
||||
default_account = Webfinger.new('diasporahq@joindiaspora.com').fetch
|
||||
if AppConfig.settings.autofollow_on_join?
|
||||
default_account = Webfinger.new(AppConfig.settings.autofollow_on_join_user).fetch
|
||||
self.share_with(default_account, aq) if default_account
|
||||
end
|
||||
aq
|
||||
|
|
|
|||
|
|
@ -53,7 +53,8 @@ defaults:
|
|||
settings:
|
||||
pod_name: 'Diaspora*'
|
||||
enable_registrations: true
|
||||
follow_diasporahq: true
|
||||
autofollow_on_join: true
|
||||
autofollow_on_join_user: 'diasporahq@joindiaspora.com'
|
||||
invitations:
|
||||
open: true
|
||||
count: 25
|
||||
|
|
@ -121,7 +122,8 @@ development:
|
|||
server:
|
||||
unicorn_worker: 1
|
||||
settings:
|
||||
follow_diasporahq: false
|
||||
autofollow_on_join: false
|
||||
autofollow_on_join_user: ''
|
||||
production:
|
||||
i_am_a_dummy: # Remove if you add an actual override
|
||||
test:
|
||||
|
|
@ -132,7 +134,8 @@ test:
|
|||
assets:
|
||||
serve: true
|
||||
settings:
|
||||
follow_diasporahq: false
|
||||
autofollow_on_join: false
|
||||
autofollow_on_join_user: ''
|
||||
invitations:
|
||||
open: true
|
||||
services:
|
||||
|
|
|
|||
|
|
@ -205,12 +205,16 @@ configuration: ## Section
|
|||
## the first registration (you).
|
||||
#enable_registrations: true
|
||||
|
||||
## Set this to false if you don't want your users to follow the
|
||||
## diasporahq@joindiaspora.com account on account creation.
|
||||
## Users will automatically follow a specified account on creation
|
||||
## Set this to false if you don't want your users to automatically
|
||||
## follow an account upon creation.
|
||||
#autfollow_on_join: true
|
||||
|
||||
## The diasporahq account helps users start with some activity in
|
||||
## their stream and get news about Diaspora, but if you don't want
|
||||
## your server to contact joindiaspora.com, set this to false:
|
||||
#follow_diasporahq: false
|
||||
## your server to contact joindiaspora.com, you can change account
|
||||
## below or set autofollow_on_join to false
|
||||
#autofollow_on_join_user: 'diasporahq@joindiaspora.com'
|
||||
|
||||
## Settings about invitations
|
||||
invitations: ## Section
|
||||
|
|
|
|||
|
|
@ -864,26 +864,29 @@ describe User do
|
|||
end
|
||||
end
|
||||
|
||||
describe "diasporahq sharing" do
|
||||
describe "autofollow sharing" do
|
||||
let(:user) {
|
||||
FactoryGirl.create(:user)
|
||||
}
|
||||
|
||||
before(:each) do
|
||||
@old_followhq_value = AppConfig.settings.follow_diasporahq?
|
||||
@old_autofollow_value = AppConfig.settings.autofollow_on_join?
|
||||
@old_autofollow_user = AppConfig.settings.autofollow_on_join_user
|
||||
end
|
||||
|
||||
after(:each) do
|
||||
AppConfig.settings.follow_diasporahq = @old_followhq_value
|
||||
AppConfig.settings.autofollow_on_join = @old_followhq_value
|
||||
AppConfig.settings.autofollow_on_join_user = @old_autofollow_user
|
||||
end
|
||||
|
||||
context "with sharing with diasporahq enabled" do
|
||||
it "should start sharing with the diasporahq account" do
|
||||
AppConfig.settings.follow_diasporahq = true
|
||||
context "with autofollow sharing enabled" do
|
||||
it "should start sharing with autofollow account" do
|
||||
AppConfig.settings.autofollow_on_join = true
|
||||
AppConfig.settings.autofollow_on_join_user = 'one'
|
||||
|
||||
wf_mock = mock
|
||||
wf_mock.should_receive(:fetch)
|
||||
Webfinger.should_receive(:new).and_return(wf_mock)
|
||||
Webfinger.should_receive(:new).with('one').and_return(wf_mock)
|
||||
|
||||
user.seed_aspects
|
||||
end
|
||||
|
|
@ -891,7 +894,7 @@ describe User do
|
|||
|
||||
context "with sharing with diasporahq enabled" do
|
||||
it "should not start sharing with the diasporahq account" do
|
||||
AppConfig.settings.follow_diasporahq = false
|
||||
AppConfig.settings.autofollow_on_join = false
|
||||
|
||||
Webfinger.should_not_receive(:new)
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue