Skip to content
This repository was archived by the owner on Mar 1, 2023. It is now read-only.

Commit be504fd

Browse files
authored
Allow creation of sharable retro from admin panel (fixes #308) (#376)
1 parent db129ae commit be504fd

File tree

6 files changed

+30
-3
lines changed

6 files changed

+30
-3
lines changed

api/app/admin/retros.rb

+3-1
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,8 @@
7070

7171
column('Private', :is_private)
7272

73+
column('Magic Link', :is_magic_link_enabled)
74+
7375
column('User', :user)
7476
actions
7577
end
@@ -133,7 +135,7 @@
133135
f.input :video_link
134136
f.input :owner_email
135137
f.input :is_private
136-
f.input :magic_link_enabled, as: :boolean
138+
f.input :is_magic_link_enabled, as: :boolean
137139
end
138140

139141
f.inputs do

api/config/locales/en.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ en:
7272
labels:
7373
retro:
7474
is_private: "Make this retro private?"
75-
magic_link_enabled: "Share this retro using a magic link?"
75+
is_magic_link_enabled: "Share this retro using a magic link?"
7676
owner_email: "Owner Email"
7777
hints:
7878
retro:

api/spec/admin/admin_retros_request_spec.rb

+2
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,7 @@ def click_column(doc, panel_name, column_name, expected_order)
129129
'Ordered By',
130130
'Password',
131131
'Private',
132+
'Magic Link',
132133
'User'
133134
])
134135
end
@@ -151,6 +152,7 @@ def click_column(doc, panel_name, column_name, expected_order)
151152
expect(data[11]).to eq('the-video-link')
152153
expect(data[13]).to include('Yes')
153154
expect(data[14]).to include('Yes')
155+
expect(data[15]).to include('No')
154156
end
155157

156158
it 'has a filter for public/private retros' do

e2e.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ popd >/dev/null
119119

120120
pushd "$BASE_DIR/e2e" >/dev/null
121121
echo 'Running E2E tests...'
122-
bundle exec rspec $1
122+
bundle exec rspec "$@"
123123
popd >/dev/null
124124

125125
# Shutdown services

e2e/spec/felicity_journey_spec.rb

+12
Original file line numberDiff line numberDiff line change
@@ -252,6 +252,18 @@
252252
end
253253
end
254254

255+
context 'from admin panel' do
256+
specify 'sharing a retro' do
257+
slug = 'i-can-be-shared'
258+
password = 'opensesame'
259+
create_sharable_retro_as_admin(slug, password)
260+
visit "#{RETRO_APP_BASE_URL}/retros/#{slug}"
261+
fill_in 'Password', with: password
262+
click_on 'Login'
263+
expect(get_share_url).to include "/retros/#{slug}/join/"
264+
end
265+
end
266+
255267
specify 'Auto facilitation journey' do
256268
register('felicity-auto-facilitate-user')
257269
create_public_retro

e2e/spec/spec_helper.rb

+11
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,17 @@ def add_auth_token
8686
page.driver.execute_script("window.localStorage.setItem('authToken', 'secret-test-user-token-ef87c521b979');")
8787
end
8888

89+
def create_sharable_retro_as_admin(slug, password)
90+
login_as_admin
91+
click_on 'Retros'
92+
click_on 'New Retro'
93+
fill_in 'Name', with: 'Sharable retro'
94+
fill_in 'Slug', with: slug
95+
fill_in 'Password', with: password
96+
page.check 'Share this retro using a magic link?'
97+
click_on 'Create Retro'
98+
end
99+
89100
def create_private_retro(team_name = nil)
90101
fill_in_create_retro_form(team_name)
91102
find('#retro_is_magic_link_enabled', visible: :all).set(true)

0 commit comments

Comments
 (0)