forked from pqrkchqps/diehard-dot-fund_onboarding
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathplugin.rb
36 lines (33 loc) · 1.52 KB
/
plugin.rb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
module Plugins
module LoomioOnboarding
class Plugin < Plugins::Base
setup! :loomio_onboarding do |plugin|
plugin.enabled = true
plugin.use_component :group_progress_card, outlet: [:before_group_page_column_right, :before_thread_page_column_right]
# plugin.use_component :user_progress_card, outlet: :after_user_username
plugin.use_translations 'config/locales', :loomio_onboarding
plugin.use_test_route(:setup_progress_card_coordinator) do
GroupService.create(group: create_group, actor: patrick)
test_subgroup = FormalGroup.new(name: 'Johnny sub',
parent: create_group,
discussion_privacy_options: 'public_or_private',
group_privacy: 'closed')
GroupService.create(group: test_subgroup, actor: patrick)
create_group.update_attribute(:description, 'Here is a group description')
create_group.logo = File.new("#{Rails.root}/spec/fixtures/images/strongbad.png")
create_group.cover_photo = File.new("#{Rails.root}/spec/fixtures/images/strongbad.png")
create_group.save
patrick.avatar_kind = 'gravatar'
patrick.save
sign_in patrick
create_discussion
redirect_to group_url(create_group)
end
plugin.use_test_route(:setup_progress_card_member) do
sign_in jennifer
redirect_to group_url(create_group)
end
end
end
end
end