Skip to content

Commit aa0003e

Browse files
committed
wip choices needs spec
1 parent dcff9e2 commit aa0003e

File tree

2 files changed

+15
-7
lines changed

2 files changed

+15
-7
lines changed

db/seeds/event_questions.rb

+12-4
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,24 @@
44
# hitobito_swb and licensed under the Affero General Public License version 3
55
# or later. See the COPYING file at the top-level directory or at
66
# https://github.com/hitobito/hitobito_swb.
7+
#
8+
TOURNAMENT_CHOICES = [
9+
"HE / SM",
10+
"DE / SD",
11+
"HD / DM",
12+
"DD / DD",
13+
"MX / DX"
14+
]
715

816
Event::Question.seed_global({
917
event_type: "Event::Tournament", # Is derived for every event
1018
multiple_choices: true,
1119
admin: true,
1220
disclosure: :required,
1321
translation_attributes: [
14-
{ locale: "de", question: "In welchen Disziplinen tritts du an?", choices: "Single,Double,Mixed" },
15-
{ locale: "fr", question: "Dans quelles disciplines concourrez-vous?", choices: "Single,Double,Mixed" },
16-
{ locale: "it", question: "In quali discipline gareggia?", choices: "Single,Double,Mixed" },
17-
{ locale: "en", question: "In which disciplines do you compete?", choices: "Single,Double,Mixed" },
22+
{ locale: "de", question: "In welchen Disziplinen tritts du an?", choices: TOURNAMENT_CHOICES },
23+
{ locale: "fr", question: "Dans quelles disciplines concourrez-vous?", choices: TOURNAMENT_CHOICES },
24+
{ locale: "it", question: "In quali discipline gareggia?", choices: TOURNAMENT_CHOICES },
25+
{ locale: "en", question: "In which disciplines do you compete?", choices: TOURNAMENT_CHOICES },
1826
]
1927
})

spec/features/events_spec.rb

+3-3
Original file line numberDiff line numberDiff line change
@@ -19,15 +19,15 @@
1919
Fabricate(:external_training, group_ids: [group.id])
2020
end
2121

22-
it "can view trainings on group" do
23-
visit group_path(group)
22+
it "can view external trainings on group" do
23+
click_on "Swiss Badminton"
2424
within("#content") do
2525
click_on "Externe Ausbildungen"
2626
end
2727
expect(page).to have_content training.name
2828
end
2929

30-
it "can view trainings top level" do
30+
it "can view external trainings top level" do
3131
within("#page-navigation") do
3232
click_on "Externe Ausbildungen"
3333
expect(page).to have_content training.name

0 commit comments

Comments
 (0)